#1
|
|||
|
|||
use VBA to enter cell and edit existing text
Hi All,
Just trying to tweak my system a bit, I have this bit of code to add data to some cells , after adding this i would like to enter one of those cell and start typing. If i double click the cell it will run other VBA code so don't want to have to do that to start typing. Is there a way using VBA to select the cell and have the cursor positioned at the end of the existing text ready to add more text. Code:
If Not Intersect(Target, Sh.Range("D4:D5000")) Is Nothing Then tttt = Format(Date, "ddmmyy") Sheets("Clipsal Customer").Range("A" & ActiveCell.Row) = "RMA" & tttt & "CC-" Sheets("Clipsal Customer").Range("B" & ActiveCell.Row) = Date Sheets("Clipsal Customer").Range("C" & ActiveCell.Row) = "Received for Repair" Sheets("Clipsal Customer").Range("A" & ActiveCell.Row).Select ' Code to place here to enter cell and start typing End If |
#2
|
||||
|
||||
If you're double-clicking and getting activity, I take it you already know how to use events in worksheets. Seems to me, then, that what you want is the SelectionChange event. Your routine can check that the new Selection is the particular cell you want to behave in that way; if it is, the routine can then put you Edit mode.
At least I think it can. I've never programmed the <F2> mode into VBA, but I presume that can be done. |
#3
|
|||
|
|||
Thanks for the reply,
I think i have a working solution though. I am using the dbl click event to check the string length and if it's the same as the length i just entered then exit the sub, still working out some minor bugs with it. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
2013 how to edit an existing filter | altja | Project | 1 | 02-15-2014 07:06 AM |
Enter text into next available cell in a table | molesy | Word VBA | 2 | 09-11-2013 02:25 AM |
Edit of existing report | abbertonian | Project | 3 | 04-10-2013 07:56 AM |
Check box and text box in same document ? cant edit / enter text | KennyG | Word | 6 | 04-08-2013 10:59 AM |
Enter + Alt + Enter is not working inside the text box! why???? | Jamal NUMAN | Word | 3 | 04-17-2011 05:35 PM |