Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Positioning the Insertion Point in a TextBox

I've been wrestling with this one for days, and I just can't
seem to pull it off. What I'd like to do when a certain TextBox
on a UserForm takes the focus is to have the insertion point
automatically move one space to the left. So, for example,
if the TextBox contains ""ABC" upon taking the focus what
I want to see is "AB|C"; I've been trying to do this by using
Application.SendKeys "{LEFT}" in some manner but to no
avail. I can obviously do it manually by pressing the left arrow
key, but I want to do it in VBA so as to remind the user of how
the data entry appearing in that particular TextBox is to be
modified. Anyone have any ideas on how to do this?

-- Dennis Eisen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Positioning the Insertion Point in a TextBox

Check out the "selstart" property of the textbox.
Setting selstart to len(textbox text)-1 and sellength to 0 should do
it.
Tim


"DennisE" wrote in message
...
I've been wrestling with this one for days, and I just can't
seem to pull it off. What I'd like to do when a certain TextBox
on a UserForm takes the focus is to have the insertion point
automatically move one space to the left. So, for example,
if the TextBox contains ""ABC" upon taking the focus what
I want to see is "AB|C"; I've been trying to do this by using
Application.SendKeys "{LEFT}" in some manner but to no
avail. I can obviously do it manually by pressing the left arrow
key, but I want to do it in VBA so as to remind the user of how
the data entry appearing in that particular TextBox is to be
modified. Anyone have any ideas on how to do this?

-- Dennis Eisen



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Positioning the Insertion Point in a TextBox

Tim,
Thanks. That indeed did the trick.

-- Dennis Eisen
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
Change Insertion Point Sandman Excel Discussion (Misc queries) 2 July 5th 08 04:44 PM
Position insertion point at beginning of cell when editing Sue Excel Discussion (Misc queries) 9 March 28th 08 05:37 PM
Why did my Excel insertion point change to a cross? TrishF New Users to Excel 2 February 4th 07 08:11 PM
how to change the insertion point color? smc11ca Excel Worksheet Functions 0 October 31st 06 05:11 PM
causing macros to run at insertion point Inobugs Excel Worksheet Functions 3 February 1st 06 06:19 AM


All times are GMT +1. The time now is 03:25 AM.

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"