Skip to Main Content

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…

 

Leave a Reply

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