Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InputBox- Is it Possible

Status
Not open for further replies.

mbarnett

MIS
Jun 15, 2003
123
US
Hi All,

I have a macro that I run from a certain cell, but this cell is always changing( always in the same column)- It can be J10 today or J227 depending how much info there is. I always have to go in the code and change the cell ref. I could not figure out how to use a InputBox to put in a cell ref and have the macro run frommy input.

Thanks
Mark
 
myCell = inputbox("Enter The Cell Address")

Range(myCell).select
would then work

However, if this is always the last cell in the column, you could use
myRow = range("J65536").end(xlup).row
Range("J" & myRow).select

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
Get the best answers to your questions - faq222-2244
 
Couldn't you just name the cell and reference the name of the cell in code rather than the address?

ie:

Range("CellName").select
 
Thanks. I will give it a try. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top