I have a macro that is kicked off by a subroutine button click:
if I step through the code, it seems to return to the Private Sub ListBox1_Click()
routine every time it performs a funtion
e.g.
in the above code, when it runs the ".Destination = Sheets..." line, it goes to the ListBox1_Click Subroutine and goes through it twice, before returning to the macro.
then after the ".Refresh BackgroundQuery.." line, it goes back to the ListBox1_Click and goes through ti twice. etc
it does this every time it comes to similar code in the rest of my macro.
any ideas???
Code:
Private Sub CommandButton1_Click()
Man = TextBox1.Value
Call AutoFOB(Man)
End Sub
_________________________________________________
Private Sub ListBox1_Click()
TextBox1.Value = ListBox1.Value
End Sub
if I step through the code, it seems to return to the Private Sub ListBox1_Click()
routine every time it performs a funtion
e.g.
Code:
With Sheets("Development and Design").QueryTables(1)
.Destination = Sheets("Development and Design").Cells(1, 1)
.Connection = sConn
.CommandText = sSQL
.Refresh BackgroundQuery:=False
End With
then after the ".Refresh BackgroundQuery.." line, it goes back to the ListBox1_Click and goes through ti twice. etc
it does this every time it comes to similar code in the rest of my macro.
any ideas???