Range in R1C1 format in VBA

Wook

Board Regular
Joined
Apr 29, 2003
Messages
78
What I want to do is loop though a row using "i" as the column number. However because the column are A, B, C.... etc and not 1, 2, 3,.... I am finding this hard to do. I don't want to get into Chr(65), Chr(66),... because this becomes a problem when you hit AA. I would think there should be an easy way to use R1C1 in a range ie. Range("R1C5") being the same as Range("E1"), but I can't seem to see anything useful in the help files.

Cheers, Wook
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
instead of:
Range("E1")

use:
Cells(1, 5)

where '1' represents the row and '5' represents the column (in this example, E)

hth
kevin
 
Upvote 0
Hi Wook:

Have you considered using the Cells Property? It uses Row and Column numbers like in R1C1 style rather than column labels and rows numbers in A1 style.
 
Upvote 0

Forum statistics

Threads
1,215,541
Messages
6,125,413
Members
449,223
Latest member
Narrian

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