Hi All
I'm completely stumped here. I've written the following macro for a Scorecard workbook I'm creating. The basics of what it's meant to do are:
* have one workbook to collate data from various other workbooks
* main workbook (called Launchpad), has a "Data" tab, which lists all of the file names from which to pull data
* on click of a button, the macro starts
* the first thing it does is go to the "Master" tab, and clear any info from the table (so that it gets refreshed)
* it then opens the first workbook from cell A1 in the Data tab
* in the now open workbook it goes to a designated cell, filters out the blanks, selects all data in the table and copies it
* it then goes to the "Master" tab in the Launchpad workbook and pastes the data
* it then returns to the other workbook, unfilters the table (putting the blanks back in), saves and closes that workbook
* lastly it returns again to Launchpad to the Data tab and moves down one cell to the next file name
* a loop then starts where the workbook opens the next file, filters, copies, returns, pastes etc.
* this is meant to occur in a loop until a blank cell is reached on the Data tab
Now, the issue I'm having is:
* if I run the macro from VBA, it works one time, going through the loop as intended. The next time I run it, it seems to only go once, stopping after the first run of code (before the loop starts). If I run again, it works. Every second time ...
* if I run the macro from the button click, as intended, it also runs through once, stopping before the loop (i.e. only one workbook's data is grabbed). It never loops from the button.
The code is:
Any help would be much appreciated. Thanks guys!!!
Bookmarks