Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Selects a letter

I need a macro that selects the letter out of a cell address without the $
sign.

Thanks for your help in advance.

Severn


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Selects a letter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Selects a letter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Selects a letter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Selects a letter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Selects a letter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Selects a letter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Selects a letter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Selects a letter

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Name for box that selects everything? dlw Excel Discussion (Misc queries) 1 April 15th 09 04:23 PM
New Validation option to format 1st letter as Capital letter Jeff Excel Discussion (Misc queries) 5 July 13th 06 05:11 AM
Default Capital letter for 1st letter of a word Jeff Excel Discussion (Misc queries) 6 July 10th 06 08:36 AM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM
press letter and go 2 entry begin w letter in data validation drop MCP Excel Programming 1 August 28th 04 05:07 PM


All times are GMT +1. The time now is 09:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"