Progress Bar - extend run time
Hi All,
My first time here and a total newbie to Macros/VBA and the like. Although I have been dabbling for a few weeks and have come on leaps and bounds. I am looking for some help regarding a progress bar I have added to a file at work. My apologies if this is long-winded.
I have 1 excel file which is a direct download from SAP and another excel file which takes the information contained in the download and turns it into meaningful data.
When I run the macro the following happens:
1) Unwanted data (columns) from the download are removed and a filter is added to one of them.
2) The data is filtered by a set of criteria then copied and pasted onto a worksheet in the breakdown. There are 3 bits of criteria each pasted onto 3 different sheets.
3) The data pasted onto the 3 sheets then does a lookup to another file to autofill supplier information.
All together the process moves anywhere from 100 to 2000 rows of data (depending on when in the month the download is done) and does a lookup of the same amount.
I added a progress bar using the standard MS bars and the code suggested by johnske successfully. However, the bar only runs while the macro is sorting and moving the data, then freezes on the screen while the lookup is happening.
Here's the crunch question - how, if possible at all, do I get the progress bar to run throughout the lookup process as well??
I hope someone can help,
Kind regards,
Mick.
Subroutine parameters versus Public data
Assuming I am calling a subroutine and sending it arguments, is it a two-way passing of data or is it better to use "public variables" if the sub is going to modify this data (logically send it back)? For example:[vba] Dim abc as Strng
Dim xyz as String
...
Call Sub1(abc, xyz)
...
Sub1 (abc as String, xyz as String)
...
abc = abc & "This is an added string of characters"
...
End Sub [/vba]
This is important DEPENDING on the way VBA allocates storage for variables. The alternative would be:
[vba] Public abc as String
Public xyz as String
...
Call Sub1
...[/vba]
I apologize for using this thread.
I goofed. I thought I was creating a new thread, and I do apologize for any inconvenience I may have caused.
Consider the issue closed. I do thank xld for his suggestion.