+ Reply to Thread
Results 1 to 5 of 5

Cell references in VBA?

  1. #1
    GoBobbyGo
    Guest

    Cell references in VBA?

    How do I find out which cell I've selected?

    I have a VBA routine that selects a (one-cell) named range, which will
    likely move around due to row/column insertions and deletions.

    How can I get VBA to know what actual cell it's in?

  2. #2
    Bob Phillips
    Guest

    Re: Cell references in VBA?

    Activecell is the active cell of a selection, so if the selection is one
    cell, it is also the selection.

    You can work with that

    Msgbox Activecell.Value

    or get properties of it

    Msgbox Activecell.Address

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "GoBobbyGo" <[email protected]> wrote in message
    news:[email protected]...
    > How do I find out which cell I've selected?
    >
    > I have a VBA routine that selects a (one-cell) named range, which will
    > likely move around due to row/column insertions and deletions.
    >
    > How can I get VBA to know what actual cell it's in?




  3. #3
    Forum Contributor
    Join Date
    04-11-2005
    Location
    London
    Posts
    259
    Any easy way to get the X and Y coords of the cell?
    Martin Short

  4. #4
    Bob Phillips
    Guest

    Re: Cell references in VBA?

    You can get it relative to the spreadsheet with Activecell.Left and .Top.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "MartinShort" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Any easy way to get the X and Y coords of the cell?
    >
    >
    > --
    > MartinShort
    >
    > Software Tester
    > ------------------------------------------------------------------------
    > MartinShort's Profile:

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




  5. #5
    Forum Contributor
    Join Date
    04-11-2005
    Location
    London
    Posts
    259
    Cheers Bob

+ 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