macro to refer to the cell content

cstarnite

New Member
Joined
Jul 18, 2007
Messages
12
I have a spreadsheet that I update weekly. Each column contains the new week. In excel I created a lookup to take the current data date and find the input column/row (e.g. cell b5 results equal CB9 the range value). In my macro range(" ").select... I want the value in cell b5 to be my value for the range in my macro range("CB9").select. Does that make sense?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

You should probably post your code, especially if you're doing a lot of selecting, which is generally unnecessary.

In the meantime is this what you want:

Code:
Range([B5]).Select

Or if you have to refer to another sheet:

Code:
Range(Sheets("Sheet1").Range("B5").Value).Select

Hope that helps,

Smitty
 
Upvote 0

Boller

Banned
Joined
Apr 11, 2006
Messages
2,328
Or if you have to refer to another sheet:

Code:
Range(Sheets("Sheet1").Range("B5").Value).Select

Would probably need to be :-

Code:
ActiveSheet.Range(Sheets("Sheet1").Range("B5").Value).Select
 
Upvote 0

Forum statistics

Threads
1,191,177
Messages
5,985,137
Members
439,941
Latest member
robertv13

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
Top