Hello Andy,
Here is an example using both Message Boxes and Input Boxes in a macro. I wasn't quite sure want you were after for the Printer example, so I substituted an example of calling the Printer Dialog within Excel. The individual parts could be used as needed in your code when you need a response from the user. If you have any questions you can contact me via private message here at the forum or email me [email protected]
Example:
Sub QueryTest()
Dim Email
Dim Fax
Dim RetVal
RetVal = MsgBox("Do you wish to send an Email?", vbQuestion + vbYesNo)
If RetVal = vbYes Then
Email = InputBox("Please Enter the Email address below.")
End If
RetVal = MsgBox("Do you want to send a Fax?", vbQuestion + vbYesNo)
If RetVal = vbYes Then
Fax = InputBox("Please enter the Fax number below.")
End If
RetVal = MsgBox("Do you want a Printout?", vbQuestion + vbYesNo)
If RetVal = vbYes Then
Excel.Application.Dialogs(xlDialogPrint).Show
End If
End Sub
Sincerely,
Leith Ross
Bookmarks