Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Column Name (Excel2003)

    Hi!
    I need to get Name of the Columns.
    What is the property for it?
    I can get a number but I need name

    am using
    lColumnCount = Sheets(i).[b].CurrentRegion.Columns.Count
    It gives me 34 Columns and I need to find last column's Name.
    Is there way?

    Thanks

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Column Name (Excel2003)

    Like this:

    Option Explicit

    Sub test()
    Dim iCol As Integer
    Dim sAddr As String
    iCol = 34
    sAddr = ActiveSheet.Cells(1, iCol).Address
    MsgBox Mid(sAddr, 2, InStr(2, sAddr, "$") - 2)
    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Column Name (Excel2003)

    That WORKS!
    THANKS, Pieterse

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •