Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi -
I have a ton of data that I have built a macro (Macro 1) for assuming that all the data was going to be in the same location in each spreadsheet. Of course it turns out some sheets are different but they are all different in the same way. So, I built another macro (Macro2) that moves the data back over to correspond with Macro1 but now I need another macro that will decide whether or not Macro 2 needs to be run. So the sheets with the data in the wrong location all have column Q4-14 blank and the columns are not blank in the correct data... so the macro needs to say something like this: If the cell.value of Q4 = blank, then run macro 2, otherwise run macro1 Sorry, I know this is easy but I can't figure it out. Any help would be appreciated. Thanks Alex |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or I guess it can say
If cell.value of Q4=blank then go to next step, otherwise stop this macro |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't you want to always run macro1, but you sometimes want to run macro2
first: if Range("Q4").Value = "" then macro2 End if macro1 or to check all the cells in Q4:Q14: if application.CountA(Range("Q4:Q14")) = 0 then macro2 End if macro1 -- Regards, Tom Ogilvy " wrote: Hi - I have a ton of data that I have built a macro (Macro 1) for assuming that all the data was going to be in the same location in each spreadsheet. Of course it turns out some sheets are different but they are all different in the same way. So, I built another macro (Macro2) that moves the data back over to correspond with Macro1 but now I need another macro that will decide whether or not Macro 2 needs to be run. So the sheets with the data in the wrong location all have column Q4-14 blank and the columns are not blank in the correct data... so the macro needs to say something like this: If the cell.value of Q4 = blank, then run macro 2, otherwise run macro1 Sorry, I know this is easy but I can't figure it out. Any help would be appreciated. Thanks Alex |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much Tom. You're great!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MACRO PASTE CELL to COLUMN, SKIP ROWS | Excel Discussion (Misc queries) | |||
How do I skip a blank cell within macro? | Excel Programming | |||
Macro to run if cell empty | Excel Programming | |||
macro to look for empty cell | Excel Discussion (Misc queries) | |||
How to skip empty cells while running a macro? | Excel Programming |