Hi
I have a macro which updates Pivot tables in my spreadsheet.
However, if a range of cells in a specific tab, let's say Sheet2, is blank, then I don't want to run the macro.
@Fluff helped me out with the code below, which checks if two cells that in Sheet6 are blank, then exits the Sub, if they are. And this code is really useful!
However, I need to do something similar for a separate tab, so if cells AM15:AM66 were blank, then the Sub would stop running.
Any thoughts on how to add this to the bottom of this code would be greatly appreciated....
I have a macro which updates Pivot tables in my spreadsheet.
However, if a range of cells in a specific tab, let's say Sheet2, is blank, then I don't want to run the macro.
@Fluff helped me out with the code below, which checks if two cells that in Sheet6 are blank, then exits the Sub, if they are. And this code is really useful!
However, I need to do something similar for a separate tab, so if cells AM15:AM66 were blank, then the Sub would stop running.
Any thoughts on how to add this to the bottom of this code would be greatly appreciated....
VBA Code:
Sheet6.Visible = True
'check if cells B3 and C3 in Sheet 6 have data.
Sheet6.Activate
If Range("B3") = "" And Range("C3") = "" Then
MsgBox "Check that Tab 6 has been populated"
Exit Sub
End If