Input box and assigning to a variable.

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.
 
B

Bob Flanagan

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
 
S

stevebriz

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top