Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2020, 03:36 PM
trevorc trevorc is offline use VBA to enter cell and edit existing text Windows 7 32bit use VBA to enter cell and edit existing text Office 2013
Competent Performer
use VBA to enter cell and edit existing text
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default 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
Reply With Quote
  #2  
Old 06-13-2020, 12:16 PM
BobBridges's Avatar
BobBridges BobBridges is offline use VBA to enter cell and edit existing text Windows 7 64bit use VBA to enter cell and edit existing text Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

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.
Reply With Quote
  #3  
Old 06-14-2020, 11:59 AM
trevorc trevorc is offline use VBA to enter cell and edit existing text Windows 7 32bit use VBA to enter cell and edit existing text Office 2013
Competent Performer
use VBA to enter cell and edit existing text
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes


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
use VBA to enter cell and edit existing text 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
use VBA to enter cell and edit existing text Enter + Alt + Enter is not working inside the text box! why???? Jamal NUMAN Word 3 04-17-2011 05:35 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft