TextBox and InputBox

D

Dennis Chou

How can I get a textbox to display the range selected in an input box?

for example, if the user selects range a1 in an inputbox, i'd like the
textbox to display the range "=a1"
 
R

Rick Rothstein

I'm guessing you used the Application InputBox with a type=8 in order to
return a range object. Since it is a range that is returned, you can just
specify its address and concatenate the equal sign to the front of it...

TextBox1.Value = "=" & Application.InputBox("What is the range?", _
"Get Range", , , , , , 8).Address
 
D

Dennis Chou

Thanks, that worked
Rick Rothstein said:
I'm guessing you used the Application InputBox with a type=8 in order to
return a range object. Since it is a range that is returned, you can just
specify its address and concatenate the equal sign to the front of it...

TextBox1.Value = "=" & Application.InputBox("What is the range?", _
"Get Range", , , , , , 8).Address
 

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