#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Columns

Hi!

I am interested in getting the column of a cell.
If cell D1 is selected and I use this code...

Msgbox Activecell.Column

....then I get 4 inth msgbox. How can I get 'D'?

Regards

Clarkie


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Columns

Clark,

from Chip Pearson (found with Google Search)

ColLetter = Left(Cells(1, ColNumber).Address(True, False), _
1 - (ColNumber 26))

steve

"Clark B" wrote in message
...
Hi!

I am interested in getting the column of a cell.
If cell D1 is selected and I use this code...

Msgbox Activecell.Column

...then I get 4 inth msgbox. How can I get 'D'?

Regards

Clarkie




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Columns

Clark,

Use

MsgBox Chr(ActiveCell.Column + 64)

--

HTH

Bob Phillips

"Clark B" wrote in message
...
Hi!

I am interested in getting the column of a cell.
If cell D1 is selected and I use this code...

Msgbox Activecell.Column

...then I get 4 inth msgbox. How can I get 'D'?

Regards

Clarkie




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Columns

Thanks, works like a charm

Clarkie

"steve" wrote in message
...
Clark,

from Chip Pearson (found with Google Search)

ColLetter = Left(Cells(1, ColNumber).Address(True, False), _
1 - (ColNumber 26))

steve

"Clark B" wrote in message
...
Hi!

I am interested in getting the column of a cell.
If cell D1 is selected and I use this code...

Msgbox Activecell.Column

...then I get 4 inth msgbox. How can I get 'D'?

Regards

Clarkie







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Columns

Clark,

You're welcome!

And did you see Bob's reply
MsgBox Chr(ActiveCell.Column + 64)

Many ways to get there from here...

Highly recommend going to
www.rondebruin.nl/Google.htm
and downloading his Google Search Add-in.
It's a great way to find past responses to questions and problems.

steve

"Clark B" wrote in message
...
Thanks, works like a charm

Clarkie

"steve" wrote in message
...
Clark,

from Chip Pearson (found with Google Search)

ColLetter = Left(Cells(1, ColNumber).Address(True, False), _
1 - (ColNumber 26))

steve

"Clark B" wrote in message
...
Hi!

I am interested in getting the column of a cell.
If cell D1 is selected and I use this code...

Msgbox Activecell.Column

...then I get 4 inth msgbox. How can I get 'D'?

Regards

Clarkie











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Columns

Bob,

This will work only with columns A-Z. It doesn't work for columns
past Z.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Bob Phillips" wrote in message
...
Clark,

Use

MsgBox Chr(ActiveCell.Column + 64)

--

HTH

Bob Phillips

"Clark B" wrote in message
...
Hi!

I am interested in getting the column of a cell.
If cell D1 is selected and I use this code...

Msgbox Activecell.Column

...then I get 4 inth msgbox. How can I get 'D'?

Regards

Clarkie






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
Make Columns A&B on Sheet2 always equal Sheet1 table columns A&B KnightBall Excel Worksheet Functions 6 August 18th 09 05:48 PM
putting 2 long columns into multiple columns in excel page and sor bob_mhc Excel Discussion (Misc queries) 1 April 25th 08 07:51 AM
to convert columns to rows having mulit independent group columns Quacy Excel Worksheet Functions 1 August 22nd 06 11:20 PM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 2 July 31st 06 09:45 PM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 0 July 31st 06 05:07 PM


All times are GMT +1. The time now is 05:23 PM.

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

About Us

"It's about Microsoft Excel"