Input from a dialog

Tags
Summary

Use a dialog to get some input.

Situation

You want to get one data value from the user.

Needs

A human to type a value into a dialog, and/or read a value from a dialog.

Provides

A variable with a value.

Action

Use VBA's InputBox function.

Explanation

Example 1

Provides a numeric value.

  • Dim sRate As Single
  • sRate = InputBox("What is the rate?")

Example 2

Provides a string value.

  • Dim tName As String
  • tName = InputBox("What is the name?")