Range Using Custom Sheet Name

medberg

New Member
Joined
Jul 29, 2011
Messages
30
Hey Everyone,

I am trying to use a custom sheet name in a range and cannot get it to work. Here is what I have:
Code:
Range(Sheets("Add A Record") & "!" & Sheets("Add A Record").Cells(8, upperLeftC + columnC + 1).Address)
In this example the sheet name is obviously "Add A Record". Any help would be greatly appreciated. Thanks!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Range(Sheets("Add A Record") & "!" & Sheets("Add A Record").Cells(8, upperLeftC + columnC + 1).Address)

It looks like you are trying to use Excel worksheet formula constructions on VB objects. While I can't be sure since you didn't show us value for your variables or the cell's content or what you wanted from them, but I think this might be what you are looking for...

Code:
Sheets("Add A Record").Cells(8, upperLeftC + columnC + 1).Value
 
Upvote 0
Thanks for your reply, I appreciate it. I cannot show more code because it is confidential although I wish I could. What you suggested worked for the most part, I just had to make sure the appropriate sheet was activated first. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

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