+ Reply to Thread
Results 1 to 3 of 3

return colmn number + index

  1. #1
    Registered User
    Join Date
    11-14-2004
    Location
    Georgia
    Posts
    57

    Talking return colmn number + index

    is there any way to return the LETTER name of a column? the .Column property returns the index, but is there a simple way of returning the A, B, and so on value of column? this is what i would like to do:

    #################################

    Dim myRange as Range
    Dim rowCopy as Integer
    Dim colCopy as Integer
    Dim colCopyLetter as String
    Dim NewRange as String

    Set rowCopy = myRange.Row
    Set colCopy = myRange.Column
    Set colCopyLetter = ???
    Set NewRange = ColCopyLetter & rowCopy

    'some code

    Set myRange = (NewRange)

    ##################################

    any help?
    Brought to you by Pringles and his infinite genius. ~''~

    "Ctrl+Z is a beautiful thing."
    - Me.

  2. #2
    Don Guillett
    Guest

    Re: return colmn number + index

    look here for ways
    http://tinyurl.com/7fyl8

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "medicenpringles"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > is there any way to return the LETTER name of a column? the .Column
    > property returns the index, but is there a simple way of returning the
    > A, B, and so on value of column? this is what i would like to do:
    >
    >
    > Dim myRange as Range
    > Dim rowCopy as Integer
    > Dim colCopy as Integer
    > Dim colCopyLetter as String
    > Dim NewRange as String
    >
    > Set rowCopy = myRange.Row
    > Set colCopy = myRange.Column
    > Set colCopyLetter = ???
    > Set NewRange = ColCopyLetter & rowCopy
    >
    > 'some code
    >
    > Set myRange = (NewRange)
    >
    >
    > --
    > medicenpringles
    >
    >
    > ------------------------------------------------------------------------
    > medicenpringles's Profile:

    http://www.excelforum.com/member.php...o&userid=16458
    > View this thread: http://www.excelforum.com/showthread...hreadid=382337
    >




  3. #3
    Vasant Nanavati
    Guest

    Re: return colmn number + index

    Lots of errors here. Try:

    Dim myRange as Range
    Dim rowCopy as Long
    Dim colCopy as Integer
    Dim colCopyLetter as String
    Dim NewRange as String

    rowCopy = myRange.Row
    colCopy = myRange.Column
    colCopyLetter = Left(myRange(1, 1).Address(False, False), _
    1 - CInt(myRange(1, 1).Column > 26))
    NewRange = ColCopyLetter & rowCopy

    'some code

    Set myRange = Range(NewRange)

    But honestly, I don't quite understand what you are trying to do.

    --

    Vasant


    "medicenpringles"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > is there any way to return the LETTER name of a column? the .Column
    > property returns the index, but is there a simple way of returning the
    > A, B, and so on value of column? this is what i would like to do:
    >
    >
    > Dim myRange as Range
    > Dim rowCopy as Integer
    > Dim colCopy as Integer
    > Dim colCopyLetter as String
    > Dim NewRange as String
    >
    > Set rowCopy = myRange.Row
    > Set colCopy = myRange.Column
    > Set colCopyLetter = ???
    > Set NewRange = ColCopyLetter & rowCopy
    >
    > 'some code
    >
    > Set myRange = (NewRange)
    >
    >
    > --
    > medicenpringles
    >
    >
    > ------------------------------------------------------------------------
    > medicenpringles's Profile:
    > http://www.excelforum.com/member.php...o&userid=16458
    > View this thread: http://www.excelforum.com/showthread...hreadid=382337
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1