Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with columns

Status
Not open for further replies.

jcasas23

IS-IT--Management
Oct 10, 2003
54
MX
How Could I save in a cell the letter of the column that I selected. I need only the letter for the column for example
A1 just A
CD34 just CD and go on..

thanks in advance.

 
It this function in excel? How should I use the column() formula?

thanks
 
if I use this function in a module in VBA of excel should be work?

thanks
 
Code:
Function ColLetters()
  with activecell
    if .column > 26 then
      ColLetters = Chr(Int((.column-1)/26)+64) & _
 Chr((.column-1) MOD 26)+65)
    else
      Chr(.column+ 64)
    end if
  end with
End Function
:)

Skip,
Skip@TheOfficeExperts.com
 
Alternative solution:

Function MyCol() as string
MyCol = activecell.entirecolumn.address(0,0)
MyCol = left(MyCol,instr(MyCol,":")-1)
End Function



Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top