ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Column letter to index (https://www.excelbanter.com/excel-discussion-misc-queries/218693-column-letter-index.html)

Radon

Column letter to index
 
How do I convert column letters to column index? I have a VBA routine that
reads cells that contains destination cells. For instance, cell C2 may have
the letter D, which indicats that column D is where the output should go.

OssieMac

Column letter to index
 
In options you can set R1C1 reference style where the columns are numbered
instead of having alpha characters.

However, I am not certain that is what you are referring to because I am a
bit confused by your description of the problem. Could you post some of the
code so that we can see exactly what you are referring to.
--
Regards,

OssieMac


"Radon" wrote:

How do I convert column letters to column index? I have a VBA routine that
reads cells that contains destination cells. For instance, cell C2 may have
the letter D, which indicats that column D is where the output should go.


Jim Cone[_2_]

Column letter to index
 
Maybe...
'--
Sub MakeItNumeric()
Dim N As Long
N = Columns(Range("C2").Value).Column
MsgBox N
End Sub
--
Jim Cone
Portland, Oregon USA


"Radon"
wrote in message
How do I convert column letters to column index? I have a VBA routine that
reads cells that contains destination cells. For instance, cell C2 may have
the letter D, which indicats that column D is where the output should go.

Shane Devenshire[_2_]

Column letter to index
 
Hi,

In VBA code this will put Stuff cell D1 if the letter D is in C2 of the
active sheet.

Sub test()
Range([C2] & "1") = "Stuff"

End Sub
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Radon" wrote:

How do I convert column letters to column index? I have a VBA routine that
reads cells that contains destination cells. For instance, cell C2 may have
the letter D, which indicats that column D is where the output should go.



All times are GMT +1. The time now is 06:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com