MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Excel - Macros - Lookups

Posted by Joe Burgett on February 07, 2002 11:38 AM

I am trying to develop a macro that will select a cell somewhere on an excel spreedsheet and then wait for input for a user. I have developed some functions that determines the cell to be chosen through the use of the date and time of day. I have stored the location information in a cell. I need a macro to lookup a cells address and the go to that cell. For example, in cell A2 there is the address of B7. I need the macro to look at cell A2 and see the address B7 and then proceed to cell B7 and the wait for input for a user. I hope that my problem is understandable. Thanks for you help.

Posted by Dave S on February 07, 2002 12:17 PM

If the address of the cell that holds the address will always be a2 then, declare a variable that will hold the address info:
dim Address as string
Set the variable equal to the value in cell a2
Address=range ("a2").value
select the cell with that address:
range (Address).select
if a2 held the value b7 then b7 would be selected.

I hope this helps.

Dave S