Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Column Number/Letter

Ladies & Gentlemen,

Is there an easy way to get activecell.column to return a
letter(s) rather than a number?

The reason I'm asking is that I would like to do the
following:

activecell.value = "=sum(AA1,AB2,AC3)"

My problem is that I have the "AA", "AB", and "AC" as
numbers rather than letters.

What about converting "Cells(2,28)" into AB2?

Is there a better methond of summing a "broken range"?

Thanks in advance,

David Fixemer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Column Number/Letter

Hi david

You can use a function

Function ColumnLetter(ColNumber) As String
'Chip Pearson
ColumnLetter = Left(Cells(1, ColNumber).Address(True, False), _
1 - (ColNumber 26))
End Function

Two ways

Sub test()
MsgBox ColumnLetter(ActiveCell.Column)

' Or this one without the function
MsgBox Left(ActiveCell.Address(, False), IIf(ActiveCell.Column 26, 2, 1))

End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"david fixemer" wrote in message ...
Ladies & Gentlemen,

Is there an easy way to get activecell.column to return a
letter(s) rather than a number?

The reason I'm asking is that I would like to do the
following:

activecell.value = "=sum(AA1,AB2,AC3)"

My problem is that I have the "AA", "AB", and "AC" as
numbers rather than letters.

What about converting "Cells(2,28)" into AB2?

Is there a better methond of summing a "broken range"?

Thanks in advance,

David Fixemer



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Column Number/Letter

David,

How about

activecell.formular1c1= "=sum(R1C27,R2C28,R3C29)"

then you can use numbers

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"david fixemer" wrote in message
...
Ladies & Gentlemen,

Is there an easy way to get activecell.column to return a
letter(s) rather than a number?

The reason I'm asking is that I would like to do the
following:

activecell.value = "=sum(AA1,AB2,AC3)"

My problem is that I have the "AA", "AB", and "AC" as
numbers rather than letters.

What about converting "Cells(2,28)" into AB2?

Is there a better methond of summing a "broken range"?

Thanks in advance,

David Fixemer



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Column Number/Letter

? cells(2,28).Address(0,0)
? cells(2,28).Address(0,0)
AB2

? "=Sum(" & union(cells(3,5),cells(11,2),cells(20,8)).Address( 0,0) & ")"
=Sum(E3,B11,H20)

or
? "=Sum(" & union(cells(3,5),cells(11,2),cells(20,8)).Address & ")"
=Sum($E$3,$B$11,$H$20)


I don't think I have ever come across an instance where I had to parse out
the column letter.

--
Regards,
Tom Ogilvy


"david fixemer" wrote in message
...
Ladies & Gentlemen,

Is there an easy way to get activecell.column to return a
letter(s) rather than a number?

The reason I'm asking is that I would like to do the
following:

activecell.value = "=sum(AA1,AB2,AC3)"

My problem is that I have the "AA", "AB", and "AC" as
numbers rather than letters.

What about converting "Cells(2,28)" into AB2?

Is there a better methond of summing a "broken range"?

Thanks in advance,

David Fixemer



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
How do I turn excel columns from column number to column letter? column Setting up and Configuration of Excel 1 April 29th 08 10:15 AM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM
Auto number w/ different letter-number combos in same column Colleen B Excel Worksheet Functions 2 February 23rd 05 02:41 PM
Column Number/Letter Substitute John Wilson Excel Programming 10 January 14th 04 07:02 PM
Column Number to letter in Row Source John Wilson Excel Programming 10 December 6th 03 03:40 PM


All times are GMT +1. The time now is 12:11 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"