ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Complex User Input Box (https://www.excelbanter.com/excel-programming/347786-complex-user-input-box.html)

AndyGFLees

Complex User Input Box
 

Could someone please offer me an example of how I might achieve the
following Message/Input box in Excel and use the selections later on in
my macro:

Document Options

E-Mail Required Yes/No
E-Mail Address
Fax Required Yes/No
Fax Number
Printout Required Yes/No
Destination Printer \\example1\example1 on 1
\\example2\example2 on 2
\\example3\example3 on 3





Be kind - I am new to VBA and I am jumping straight in over my depth.


--
AndyGFLees
------------------------------------------------------------------------
AndyGFLees's Profile: http://www.excelforum.com/member.php...o&userid=29536
View this thread: http://www.excelforum.com/showthread...hreadid=492354


Norman Jones

Complex User Input Box
 
Hi Andy,

Could someone please offer me an example of how I might achieve the
following Message/Input box in Excel and use the selections later on in
my macro:

Document Options

E-Mail Required Yes/No
E-Mail Address
Fax Required Yes/No
Fax Number
Printout Required Yes/No
Destination Printer \\example1\example1 on 1
\\example2\example2 on 2
\\example3\example3 on 3



I think that a Userform would be a much better option.


Be kind - I am new to VBA and I am jumping straight in over my depth.


Debra Dalgleish has a very user-friendly tutorial at:

http://www.contextures.com/xlUserForm01.html

As you are new to VBA, you may wish to visit David McRitchie's 'Getting
Started With Macros And User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

You might also look at David's tutorials page at:

http://www.mvps.org/dmcritchie/excel....htm#tutorials

The VBA material is towards the bottom of the tutorials section.


---
Regards,
Norman



"AndyGFLees" wrote
in message ...

Could someone please offer me an example of how I might achieve the
following Message/Input box in Excel and use the selections later on in
my macro:

Document Options

E-Mail Required Yes/No
E-Mail Address
Fax Required Yes/No
Fax Number
Printout Required Yes/No
Destination Printer \\example1\example1 on 1
\\example2\example2 on 2
\\example3\example3 on 3





Be kind - I am new to VBA and I am jumping straight in over my depth.


--
AndyGFLees
------------------------------------------------------------------------
AndyGFLees's Profile:
http://www.excelforum.com/member.php...o&userid=29536
View this thread: http://www.excelforum.com/showthread...hreadid=492354




Leith Ross[_361_]

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



All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com