J
jdph40
I need help with code. With the code below, I want to be asked if I
want to delete the hours whether or not I print, but if I click "No"
to the print question, I'm not asked if I want to delete the hours.
Will someone please tell me what I need to add to my code?
Msg = "Do you want to print?"
Response = MsgBox(Msg, vbYesNo + vbQuestion)
If Response = vbYes Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Msg1 = "Do you want to delete the hours?"
Response1 = MsgBox(Msg1, vbYesNo + vbQuestion)
If Response1 = vbYes Then
Range("F3:H58").Select
Selection.ClearContents
Range("F45").Select
Else
Exit Sub
End If
End If
End Sub
Thanks!
JD
want to delete the hours whether or not I print, but if I click "No"
to the print question, I'm not asked if I want to delete the hours.
Will someone please tell me what I need to add to my code?
Msg = "Do you want to print?"
Response = MsgBox(Msg, vbYesNo + vbQuestion)
If Response = vbYes Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Msg1 = "Do you want to delete the hours?"
Response1 = MsgBox(Msg1, vbYesNo + vbQuestion)
If Response1 = vbYes Then
Range("F3:H58").Select
Selection.ClearContents
Range("F45").Select
Else
Exit Sub
End If
End If
End Sub
Thanks!
JD