Results 1 to 4 of 4

Thread: [RESOLVED] Excel: Determining Active Cell Position

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    9

    Resolved [RESOLVED] Excel: Determining Active Cell Position

    I am writing a VB Excel Macro and I am using the following code to determine the position of the active cell.

    VB Code:
    1. Dim InitialRow As Integer
    2.     Dim InitialColumn As String
    3.  
    4.     InitialRow = ActiveCell.Row
    5.     InitialColumn = ActiveCell.Column

    The problem is ActiveCell.Column returns an integer (i.e. it returns 3 instead of C). Does anyone know a way to return a C, or to convert the 3 to a C)?

    If someone knows a function to return the full cell name (Column & Row instead of Column and Row individually), that would also work.

    The reason that this is a problem is because I want to select this cell later using the function Range(<Cell>).Select, where Cell = String & Integer
    Last edited by braabe01; Jun 1st, 2006 at 07:46 AM.

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Excel: Determining Active Cell Position

    VB Code:
    1. MsgBox ActiveCell.Address
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Excel: Determining Active Cell Position

    Excel VBA question moved to Office Development

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Excel: Determining Active Cell Position

    Just for future info - I think there is a function in Excel that converts r1c1 address to the 'normal' address... Cannot remember what it was though, should be in the helpfiles or under intellisense of

    Although R1c1 makes more sense...

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

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



Click Here to Expand Forum to Full Width