Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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,
want the contents of the failed cell to be selected (so the user ca
begin typing new content for the cell without touching the mouse). Al
I know how to do is:

MyCell.Select

which selects the cell, but not its contents.

-dl

--
dl
-----------------------------------------------------------------------
dlh's Profile: http://www.excelforum.com/member.php...fo&userid=2611
View this thread: http://www.excelforum.com/showthread.php?threadid=39994

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default select contents of cell


SendKeys ... the concept I was missing. Thank you very much

--
dl
-----------------------------------------------------------------------
dlh's Profile: http://www.excelforum.com/member.php...fo&userid=2611
View this thread: http://www.excelforum.com/showthread.php?threadid=39994

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Cell Contents to Select Worksheet with Same Name as Cell Con Alan Sexter Excel Worksheet Functions 14 June 22nd 09 04:59 AM
I cannot select a single cell or pull down cell contents Carolyn Fahm Excel Worksheet Functions 0 January 24th 06 04:54 PM
How do I select & use contents of first non-blank cell in row? plf100 Excel Worksheet Functions 9 November 15th 05 12:16 PM
select a cell based on A1 contents Bill Kuunders Excel Programming 2 August 24th 05 11:23 PM
select contents of entire worksheet Dave[_22_] Excel Programming 5 August 1st 03 04:17 PM


All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"