+ Reply to Thread
Results 1 to 3 of 3

select contents of cell

  1. #1
    Forum Contributor
    Join Date
    08-09-2005
    MS-Off Ver
    2003 & 2007
    Posts
    111

    select contents of cell

    This ought to be very easy, but browsing the help files doesn't help:

    I'm writing my own data validation routine. If the validation fails, I want the contents of the failed cell to be selected (so the user can begin typing new content for the cell without touching the mouse). All I know how to do is:

    MyCell.Select

    which selects the cell, but not its contents.

    -dlh

  2. #2
    Tom Ogilvy
    Guest

    Re: select contents of cell

    Sub ValidationFailed(mycell As Range)
    mycell.Select
    SendKeys "{F2}{Home}+{End}"
    End Sub

    Sub TestCode()
    Dim mycell As Range
    Set mycell = Range("F3")
    ValidationFailed mycell
    End Sub

    --
    Regards,
    Tom Ogilvy

    "dlh" <[email protected]> wrote in message
    news:[email protected]...
    >
    > This ought to be very easy, but browsing the help files doesn't help:
    >
    > I'm writing my own data validation routine. If the validation fails, I
    > want the contents of the failed cell to be selected (so the user can
    > begin typing new content for the cell without touching the mouse). All
    > I know how to do is:
    >
    > MyCell.Select
    >
    > which selects the cell, but not its contents.
    >
    > -dlh
    >
    >
    > --
    > dlh
    > ------------------------------------------------------------------------
    > dlh's Profile:

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




  3. #3
    Forum Contributor
    Join Date
    08-09-2005
    MS-Off Ver
    2003 & 2007
    Posts
    111
    SendKeys ... the concept I was missing. Thank you very much!

+ 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