How to convert from R1C1 to A1 style (Excel 2013- VBA)?

ntc_chanh

New Member
Joined
Apr 13, 2015
Messages
1
Hi All

I had some problem when convert R1C1 to A1
Ex:
Code:
Dim aCell as String 'A1 style
Dim rcCell as String 'R1C1 style

aCell = range(rcCell).address(ReferenceStyle:=xlA1) 'Notworking with some error: Method 'Range' of object '_Global' failed
rcCell = range(aCell).address(ReferenceStyle:=xlR1C1) 'Working like a charm

Thanks
 
Last edited by a moderator:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
What does the variable rccell have in it? If it is something like R1C1, that's not a valid cell reference, hence the issue.

Regards, TMS
 
Upvote 0
You could use:
Code:
aCell = Application.ConvertFormula(Formula:=rcCell, fromreferencestyle:=xlR1C1, toreferencestyle:=xlA1)
 
Upvote 0
What is value of string rcCell before you call
Code:
aCell = range(rcCell).address(ReferenceStyle:=xlA1)

if it's like R1C1 then its not proper address for ramge.

So you shall rather use ConvertFormula for this.
 
Upvote 0

Forum statistics

Threads
1,216,747
Messages
6,132,485
Members
449,729
Latest member
davelevnt

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