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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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
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,214,881
Messages
6,122,074
Members
449,064
Latest member
MattDRT

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