|
-
Nov 14th, 2001, 06:31 AM
#1
Thread Starter
Evil Genius
Formula needed please (Excel VBA)
Can't for the life of me think of how to get round this . Here goes ...
| A | B | C |
---------------------
| 1 | 2 | 3 |
In Excel, I can use the following on the above :
Code:
Dim intCounter as integer, strMessage as String
For intcounter = 1 to ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Column
strMessage = strMessage & Range(chr(intcounter +64) & "1") & " "
Next
Msgbox strMessage
This takes the intcounter number(index of the selected column) & converts its Ascii value to a character - the column letter (A - Z).
This crashes though, when columns past Z are reached (getting into AA, AB, BA, BB, AAA etc). Can anyone think of a formula or loop I can put in to allow for these extra columns please ?
Thanks guys !
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
|
Click Here to Expand Forum to Full Width
|