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
Or I guess it can say
If cell.value of Q4=blank then go to next step, otherwise stop this
macro
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
"alexmillner@gmail.com" 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
>
>
Thank you very much Tom. You're great!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks