-
Excel Column
Is there a method to find out the column name (like "A" , "AA" )
for a cell in Excel rather than using the .Address and parse it to get the
column name? When I try the activecell.column it returns
the column number.
Any help is appreciated.
Thanks,
-Srini.
-
Re: Excel Column
Srini,
The shortest way I know is:
Left$((ActiveCell.Column).Address(False, False)), 2 + (ActiveCell.Column
< 27))
Jim Cone
*****************************************************
"Srini" <srinit74@yahoo.com> wrote:
>
>Is there a method to find out the column name (like "A" , "AA" )
>for a cell in Excel rather than using the .Address and parse it to get the
>column name? When I try the activecell.column it returns
>the column number.
>
>Any help is appreciated.
>
>Thanks,
>-Srini.
-
Re: Excel Column
Jim
Thanks for the reply.
I guess , you meant
Left$(ActiveCell.Address(False, False), 2 + (ActiveCell.Column < 27))
right??
Thanks again,
Srini.
"Jim Cone" <jim_cone@my-deja.com> wrote:
>
>Srini,
>The shortest way I know is:
>
>Left$((ActiveCell.Column).Address(False, False)), 2 + (ActiveCell.Column
>< 27))
>
>Jim Cone
>*****************************************************
>"Srini" <srinit74@yahoo.com> wrote:
>>
>>Is there a method to find out the column name (like "A" , "AA" )
>>for a cell in Excel rather than using the .Address and parse it to get
the
>>column name? When I try the activecell.column it returns
>>the column number.
>>
>>Any help is appreciated.
>>
>>Thanks,
>>-Srini.
>
-
Re: Excel Column
Srini,
Sorry, the word "Columns" was omitted.
Note that ".Address(False,False)" removes the absolute cell references ($)
so then you only need the first character if the column number is less than
27 and the first two characters otherwise.
A corrected example follows:
Sub WhatIsColumn()
Dim ColName As String
ColName = Left$(Columns(ActiveCell.Column).Address(False, False), 2 + (ActiveCell.Column
< 27))
MsgBox ColName
End Sub
***********************************************************************
"srini" <srinit74@yahoo.com> wrote:
>
>Jim
>
>Thanks for the reply.
>
>I guess , you meant
>
>Left$(ActiveCell.Address(False, False), 2 + (ActiveCell.Column < 27))
>
>right??
>
>Thanks again,
>Srini.
>
>
>"Jim Cone" <jim_cone@my-deja.com> wrote:
>>
>>Srini,
>>The shortest way I know is:
>>
>>Left$((ActiveCell.Column).Address(False, False)), 2 + (ActiveCell.Column
>>< 27))
>>
>>Jim Cone
>>*****************************************************
>>"Srini" <srinit74@yahoo.com> wrote:
>>>
>>>Is there a method to find out the column name (like "A" , "AA" )
>>>for a cell in Excel rather than using the .Address and parse it to get
>the
>>>column name? When I try the activecell.column it returns
>>>the column number.
>>>
>>>Any help is appreciated.
>>>
>>>Thanks,
>>>-Srini.
>>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks