View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Keep contents of cell when clicking on it

Here is an example for the single cell F7. Put this event macro in the
worksheet code area:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("F7")) Is Nothing Then Exit Sub
Application.SendKeys "{F2}"
DoEvents
End Sub

The code automates typeing the F2 key.


Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200824


"Karissa" wrote:

I am trying to figure out how to allow for editing a cell as soon as you
click on it ( so you don't have to click on it twice) I have a form that has
a cell made for comments and people keep complaining that every time they
click on the cell and start typing and all their previous string gets erased.
Is there a way to not have to click on it twice to go into edit mode in a
cell?

thanks for any help!
--
Karissa