Input Box for range

aa2000

Board Regular
Joined
Aug 3, 2011
Messages
87
Hello again all

I have a macro which looks at a range and the hyperlinks present in that range. The macro returns a "subscript out or range error" if no hyperlink is present in a cell.

Currently the range is:
Code:
For a = 3 To 895

Where a is an integer. While the start of the range (3) will always be the same, the end (895) will vary. How can I get the macro to get the user to put in a value for the last value? I.e an input box for the last row in the range?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try like this

Code:
x = Application.InputBox("Enter last row", Type:=1)
For a = 3 To x
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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