g48dd
Board Regular
- Joined
- Jan 12, 2009
- Messages
- 101
This macro use to run, then I had to change it a bit to make sure that it ran on Sheet3. I have had many sheets in this workbook and I am wondering if that is starting to cause problems. This is what I have at the top of my macro to make sure it runs on sheet3
The tree shows that sheet3 is actually Sheet10 it looks like this: Sheet10(Sheet3). The line Set ws1 = Worksheet("Sheet3") is what is highlighted as the problem.
I don't really have to do it this way I think I could remove all that and just put
Something like that at the end of the macro that runs before it, which brings up another question... I have about 15 macros and I am just putting:
Call Macro1
Call Macro2
Call Macro3
Call Macro4
but some of these macros will mess things up if a certain sheet is not active before it runs ... like the one I am havin g a problem with sheet3 needs to be active so is it better to call each macro when you have a lot of them? Or is better to just make them all one great big macro? I could just paste one after another I think, I have done that before it worked but it looked to me like it is easier to keep track of problems if make each one seprate. I thought finding problems would be easier. There will only be 8 sheets but about 20 macros when I am done with it.
Code:
Sub Cartridges1()
Dim ws1 As Worksheet
Set ws1 = Worksheets("Sheet3")
The tree shows that sheet3 is actually Sheet10 it looks like this: Sheet10(Sheet3). The line Set ws1 = Worksheet("Sheet3") is what is highlighted as the problem.
I don't really have to do it this way I think I could remove all that and just put
Code:
Sheets("Sheet3").Select
Range("A1").Select
Call Macro1
Call Macro2
Call Macro3
Call Macro4
but some of these macros will mess things up if a certain sheet is not active before it runs ... like the one I am havin g a problem with sheet3 needs to be active so is it better to call each macro when you have a lot of them? Or is better to just make them all one great big macro? I could just paste one after another I think, I have done that before it worked but it looked to me like it is easier to keep track of problems if make each one seprate. I thought finding problems would be easier. There will only be 8 sheets but about 20 macros when I am done with it.