View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_361_] Leith Ross[_361_] is offline
external usenet poster
 
Posts: 1
Default Complex User Input Box


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
substituted an example of calling the Printer Dialog within Excel. Th
individual parts could be used as needed in your code when you need
response from the user. If you have any questions you can contact m
via private message here at the forum or email me


EXAMPLE


Code
-------------------
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 Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49235