Ok,
Here is what I am trying to do:
Open a folder and select all excel files in it (done)
Copy all worksheets of each file into my main workbook (done)
Copy all the worksheets of my main workbook (except the one that has the macro button) within the same workbook and clear their contents (done)
Final step:
Select each original worksheet from my workbook (that has data) and run some calculations and put the results into its copy. (not done!)
In effect after I copy the sheets into my workbook my wbook tabs looks like
Sheet1 Sheet2 Console
Console is my main sheet where I will have the macro button
After I copy the worksheets within the same workbook I get something like
Sheet1 Sheet2 Console Sheet1 (2) Sheet2 (2)
That is fine. I proceed on clearing all the contents from Sheet1 (2) and Sheet2 (2).
Next I want to go back to Sheet1, run some calculations that select a specific amount of data (I have the calculation in a macro, that is fine) and put the result in Sheet1 (2). That is where I have the problem. It works for the first worksheet but it will not proceed to the rest. Keep in mind that I may have any number of worksheets, not just two.
I believe the problem is with the "Destination" worksheet and the way I describe it, I think I should create some kind of variable with it but i'm not
sure how.
Here is my code so far. It break on the line in red.
Any ideas? Also if I could rename each worksheet when it is copied to something more intelligent, i.e instead of Sheet1 to become Sheet1 (2) to have it like Sheet1_data or something like that I would be gratefull.
K
Bookmarks