VBA code in Excel only works when stepped through line by line!
Posted on 2011-02-24
I have VBA code that uses the "Activeworkbook.RefreshAll" command to update a table whose data comes from our AS400. It refreshes with an SQL query.
All the rest of my code after the refresh works fine EXCEPT a line where I'm trying to find the last row of data from the AS400. The code line is: bot = wsInstall.Cells(Cells.Rows.Count, "G").End(xlUp).Row
It won't update unless I break the code after that line, then drag the yellow arrow back up to that row and step into it again. Help!! I'm going nuts!