View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] jdph40@yahoo.com is offline
external usenet poster
 
Posts: 2
Default Excel 2003 - Code to print and/or delete

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