+ Reply to Thread
Results 1 to 6 of 6

Get selected cell name/address

  1. #1
    Registered User
    Join Date
    06-21-2005
    Posts
    16

    Get selected cell name/address

    Hi

    Is it at all possible to get the name (e.g cell A3 etc) that is selected by the cursor/mouse.

    I want to be able to do this using VBA but cannot find out how to do this.

    Thanks in advance everyone

    Dave

  2. #2
    Registered User
    Join Date
    06-21-2005
    Posts
    16
    Hey its ok, i got it.

    I just wanted to copy the info in the selected cell and place it into an input box.

    If any one was interested, then here's the code.......


    'This code gets the selected cell, copies it and places it in the input box
    Dim selectedCell As Range
    Set selectedCell = Selection
    'MsgBox selectedCell.Address
    'copy the range
    selectedCell.Copy

    'Place the text into the default property
    Dim varInput As String
    varInput = InputBox("What do you want to search for?", , selectedCell)

    Thanks

    Dave

  3. #3
    Tom Ogilvy
    Guest

    Re: Get selected cell name/address

    ActiveCell.Address

    --
    Regards,
    Tom Ogilvy

    "David494" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi
    >
    > Is it at all possible to get the name (e.g cell A3 etc) that is
    > selected by the cursor/mouse.
    >
    > I want to be able to do this using VBA but cannot find out how to do
    > this.
    >
    > Thanks in advance everyone
    >
    > Dave
    >
    >
    > --
    > David494
    > ------------------------------------------------------------------------
    > David494's Profile:

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




  4. #4
    galimi
    Guest

    RE: Get selected cell name/address

    The VBA command is

    thiscell.address
    --
    http://HelpExcel.com
    1-888-INGENIO
    1-888-464-3646
    x0197758


    "David494" wrote:

    >
    > Hi
    >
    > Is it at all possible to get the name (e.g cell A3 etc) that is
    > selected by the cursor/mouse.
    >
    > I want to be able to do this using VBA but cannot find out how to do
    > this.
    >
    > Thanks in advance everyone
    >
    > Dave
    >
    >
    > --
    > David494
    > ------------------------------------------------------------------------
    > David494's Profile: http://www.excelforum.com/member.php...o&userid=24482
    > View this thread: http://www.excelforum.com/showthread...hreadid=391783
    >
    >


  5. #5
    Tom Ogilvy
    Guest

    Re: Get selected cell name/address

    I Believe ThisCell wasn't introduced until xl2002. ActiveCell would be the
    more general choice I would think.
    --
    Regards,
    Tom Ogilvy

    "galimi" <[email protected]> wrote in message
    news:[email protected]...
    > The VBA command is
    >
    > thiscell.address
    > --
    > http://HelpExcel.com
    > 1-888-INGENIO
    > 1-888-464-3646
    > x0197758
    >
    >
    > "David494" wrote:
    >
    > >
    > > Hi
    > >
    > > Is it at all possible to get the name (e.g cell A3 etc) that is
    > > selected by the cursor/mouse.
    > >
    > > I want to be able to do this using VBA but cannot find out how to do
    > > this.
    > >
    > > Thanks in advance everyone
    > >
    > > Dave
    > >
    > >
    > > --
    > > David494
    > > ------------------------------------------------------------------------
    > > David494's Profile:

    http://www.excelforum.com/member.php...o&userid=24482
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=391783
    > >
    > >




  6. #6
    Registered User
    Join Date
    06-21-2005
    Posts
    16
    thanks guys, always good to hear about other ways of doing things.

    Dave

+ 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