The InputBox function is useful for obtaining a single input from the user. Here is the InputBox function syntax:
InputBox(prompt[,title][,default])
The arguments:
- prompt: Required. Text that is displayed in the input box.
- title: Optional. Text that appears in the input box’s title bar.
- default: Optional. The default value.
The following is an example of how to use the InputBox function:
Sub AskUserName
ActiveSheet.Range("A1").Value = InputBox("Your name?","Input Name")
End Sub
Related posts:
- The MsgBox Function
- Excel VBA Macro Examples: Sub Procedure
- Excel VBA Macro Tutorial: Range Objects
- Excel VBA Macro Tutorial: Controlling Execution
--- If you like posts in this blog, you can to support me :)
No comments:
Post a Comment