Using an Inputbox

NathanW

New Member
Joined
Jun 17, 2013
Messages
27
I've used inputboxes in the past and I do not know why I am having so much trouble now, but here is what I have:

Code:
Public StartCell As Variant
StartCell = Application.InputBox(Msg, "Select a Cell", Type:=8)
Range(StartCell).Activate

I am getting the error Run-time error '1004': Method 'Range' of object '_Global' failed.

Someone please help me!
 
That made it work! Thank you guys so much for your help and persistence. Any idea why it took all that error handling to make it work? I don't understand why this had to be so complicated =P
Did you try removing Msg from this line?
InputBox(Msg, "Select a cell", type:= 8)

Btw : the error handling is one way to deal with a user who clicks cancel when the input box appears. Without it, Application.InputBox will throw an error.
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I actually was able to leave Msg in the InputBox code, the error handling resolved the problem. Thank you again!
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,400
Members
449,156
Latest member
LSchleppi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top