Convert string to range

mmetzinger

Board Regular
Joined
Dec 30, 2010
Messages
61
I have a string variable called Bob that contains the value D2 and need it to convert it to a range called BobR. How do I do this?

I tried
Code:
Dim bob As String
Dim bobr As Range
bob = "D2"
bobr = bob

this is not an actual piece of my code exactly but I need to know how to do this in order to do my bigger piece.
 
In general terms - in R1C1 context:

Code:
FillToR.Address(,,xlR1C1)

however, I think your code is likely to fail (R1 is 0 to start with) and I believe there are possible improvements to be made, however, we'd need to have a better feel for the layout of your data.

I *think* you're looking to populate Column D with "next C Total" / "current C Total" for all "Total" rows.

If you could provide a little screen shot of your layout that would help... I use Excel Jeanie myself.
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,216,170
Messages
6,129,277
Members
449,498
Latest member
Lee_ray

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