VBA Tip: Input Boxes

Written by Rod Wing.

 

Like a Message Box, the InputBox displays a modal dialog with a message/prompt string and a tile. With an InputBox there are nooptions for what buttons to display. The InputBox always displays a text field to capture user text input. If the user selects the OK button in the InputBox dialog the string in the text field is returned as a string.

The basic InputBox function syntax is as follows:

InputBox(Prompt string, Dialog title, Default string value)

Example:

Dim strInput As String
strInput = InputBox("Enter distance", "MyMacro", "5")

1

Last Month’s Tips:


7-1-2014 3-11-35 PM          7-1-2014 3-19-50 PM      Import Button   2

MicroStation: V8i SS3             InRoads: Import                   AutoCAD Civil 3D 2014:          VBA: Get Current Value
w/ Google Earth and …             Graphics to Create …            How to Add New Pipes …               of all Your Var…
 
 
 
Don’t want to miss out on other great information? Subscribe to this blog or our monthly eNewsletter now!
Learn More ◊ Contact us today ◊ Newsletter ◊
EnvisionCAD Group EnvisionCAD YouTube Channel   

 

EnvisionCAD

Since 1996, EnvisionCAD has been a nationally recognized leader in the configuration, customization, implementation, training & support for CAD software solutions. Our individualized approach has benefited private engineering firms and government agencies alike. Basic or advanced, we can help you get the most from your CAD technology.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *