Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a macro that selects the letter out of a cell address without the $
sign. Thanks for your help in advance. Severn |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Example please?
"Roger B." wrote in message ... I need a macro that selects the letter out of a cell address without the $ sign. Thanks for your help in advance. Severn |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
Sub test() If ActiveCell.Column 26 Then MsgBox Left(ActiveCell.Address(False, False), 2) Else MsgBox Left(ActiveCell.Address(False, False), 1) End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Roger B." wrote in message ... I need a macro that selects the letter out of a cell address without the $ sign. Thanks for your help in advance. Severn |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This little macro does what you want.
Sub GetColLetter() Dim c As Range Set c = ActiveCell MsgBox Left(c.Address(0, 0), 2 + (c.Column <= 26)) End Sub HTH Otto "Roger B." wrote in message ... I need a macro that selects the letter out of a cell address without the $ sign. Thanks for your help in advance. Severn |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That will work in any current version of Excel. However, it won't
work in the next version of Excel. For Excel 12 compatibility, use Dim Rng As Range Dim ColLetter As String Set Rng = ActiveCell ColLetter = Split(Rng.Address(True, True, xlA1), "$")(1) Debug.Print ColLetter -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Otto Moehrbach" wrote in message ... This little macro does what you want. Sub GetColLetter() Dim c As Range Set c = ActiveCell MsgBox Left(c.Address(0, 0), 2 + (c.Column <= 26)) End Sub HTH Otto "Roger B." wrote in message ... I need a macro that selects the letter out of a cell address without the $ sign. Thanks for your help in advance. Severn |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Chip
Do you have a source for info (differences) in Excel 12? Otto "Chip Pearson" wrote in message ... That will work in any current version of Excel. However, it won't work in the next version of Excel. For Excel 12 compatibility, use Dim Rng As Range Dim ColLetter As String Set Rng = ActiveCell ColLetter = Split(Rng.Address(True, True, xlA1), "$")(1) Debug.Print ColLetter -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Otto Moehrbach" wrote in message ... This little macro does what you want. Sub GetColLetter() Dim c As Range Set c = ActiveCell MsgBox Left(c.Address(0, 0), 2 + (c.Column <= 26)) End Sub HTH Otto "Roger B." wrote in message ... I need a macro that selects the letter out of a cell address without the $ sign. Thanks for your help in advance. Severn |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This Blog is very good Otto
http://blogs.msdn.com/excel/default.aspx -- Regards Ron de Bruin http://www.rondebruin.nl "Otto Moehrbach" wrote in message ... Chip Do you have a source for info (differences) in Excel 12? Otto "Chip Pearson" wrote in message ... That will work in any current version of Excel. However, it won't work in the next version of Excel. For Excel 12 compatibility, use Dim Rng As Range Dim ColLetter As String Set Rng = ActiveCell ColLetter = Split(Rng.Address(True, True, xlA1), "$")(1) Debug.Print ColLetter -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Otto Moehrbach" wrote in message ... This little macro does what you want. Sub GetColLetter() Dim c As Range Set c = ActiveCell MsgBox Left(c.Address(0, 0), 2 + (c.Column <= 26)) End Sub HTH Otto "Roger B." wrote in message ... I need a macro that selects the letter out of a cell address without the $ sign. Thanks for your help in advance. Severn |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Ron. Otto
"Ron de Bruin" wrote in message ... This Blog is very good Otto http://blogs.msdn.com/excel/default.aspx -- Regards Ron de Bruin http://www.rondebruin.nl "Otto Moehrbach" wrote in message ... Chip Do you have a source for info (differences) in Excel 12? Otto "Chip Pearson" wrote in message ... That will work in any current version of Excel. However, it won't work in the next version of Excel. For Excel 12 compatibility, use Dim Rng As Range Dim ColLetter As String Set Rng = ActiveCell ColLetter = Split(Rng.Address(True, True, xlA1), "$")(1) Debug.Print ColLetter -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Otto Moehrbach" wrote in message ... This little macro does what you want. Sub GetColLetter() Dim c As Range Set c = ActiveCell MsgBox Left(c.Address(0, 0), 2 + (c.Column <= 26)) End Sub HTH Otto "Roger B." wrote in message ... I need a macro that selects the letter out of a cell address without the $ sign. Thanks for your help in advance. Severn |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
CellAddr = Left(ActiveCell.Address(True, False), InStr(1, ActiveCell.Address(True, False), "$") - 1) "Roger B." wrote: I need a macro that selects the letter out of a cell address without the $ sign. Thanks for your help in advance. Severn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Name for box that selects everything? | Excel Discussion (Misc queries) | |||
New Validation option to format 1st letter as Capital letter | Excel Discussion (Misc queries) | |||
Default Capital letter for 1st letter of a word | Excel Discussion (Misc queries) | |||
column header changed from letter to number, how return to letter | Excel Discussion (Misc queries) | |||
press letter and go 2 entry begin w letter in data validation drop | Excel Programming |