5
5elpep
Hi all, I have spent all evening trying to figure this out but to no
avail so here goes:
I am trying to build a macro which will do the following.
If worksheets "Sheet4" and "Sheet5" are hidden it unhides them and
exits the sub.
However if BOTH of these worksheets are not hidden AND cell A1 in
sheet4 + cell A1 in sheet5 <> 0
a message box is displayed prompting the user to respond yes or know.
On no the macro exits.
On yes sheets 4 & 5 are printed.
This is what I have so far.....
Any help would be greatly appreciated
_____________________________________________________________________________________________
' Macro3 Macro
' Macro recorded 14/03/2007 by elpep
' Keyboard Shortcut: Ctrl+r
If Sheets("Sheet4").Visible <> xlSheetVisible Then
Sheets("Sheet4").Visible = True
MsgBox("There seem to be pricing errors - do you wish to continue",
[VbMsgBoxStyle=vbYesNo], [,EOD Reval])
If mbRes = vbNo Then
Exit Sub
Else
Sheets(Array("Sheet4", "Sheet4")).Select
Sheets("Sheet3").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If
End Sub
____________________________________________________________________________________________
avail so here goes:
I am trying to build a macro which will do the following.
If worksheets "Sheet4" and "Sheet5" are hidden it unhides them and
exits the sub.
However if BOTH of these worksheets are not hidden AND cell A1 in
sheet4 + cell A1 in sheet5 <> 0
a message box is displayed prompting the user to respond yes or know.
On no the macro exits.
On yes sheets 4 & 5 are printed.
This is what I have so far.....
Any help would be greatly appreciated
_____________________________________________________________________________________________
' Macro3 Macro
' Macro recorded 14/03/2007 by elpep
' Keyboard Shortcut: Ctrl+r
If Sheets("Sheet4").Visible <> xlSheetVisible Then
Sheets("Sheet4").Visible = True
MsgBox("There seem to be pricing errors - do you wish to continue",
[VbMsgBoxStyle=vbYesNo], [,EOD Reval])
If mbRes = vbNo Then
Exit Sub
Else
Sheets(Array("Sheet4", "Sheet4")).Select
Sheets("Sheet3").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If
End Sub
____________________________________________________________________________________________