Input box and assigning to a variable.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Excel Programming, I want the user to punch in the field through input box
and the same is assigned to a variable. I don't know to use input box how can
i do that? and please inform me to assigning to a variable.
 
dim anyR as range
on error resume next
set anyR = application.inputbox("select a range", type:=8)
if anyR is nothing then exit sub

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 
In Excel Programming, I want the user to punch in the field through input box
and the same is assigned to a variable. I don't know to use input box how can
i do that? and please inform me to assigning to a variable.

here is another simple example

Sub test()
ans = InputBox(" Enter Data here", "My Input Box")
MsgBox ans

End Sub
 
Back
Top