+ Reply to Thread
Results 1 to 6 of 6

Textbox: Change and determine cursor position

  1. #1
    Registered User
    Join Date
    05-04-2009
    Location
    Austria
    MS-Off Ver
    Excel 2003
    Posts
    2

    Textbox: Change and determine cursor position

    Hi,

    I've got a textbox with a default value of 00:15:00 with which I want to enter a time. When I enter the textbox I want the cursor to go to the fourth position. So I tried this code:

    Please Login or Register  to view this content.
    But it doesn't work. If I use this code:

    Please Login or Register  to view this content.
    it works just fine, but that's of no use to me. Can someone explain to me what's wrong with my code and how I can jump to that position? I'd also like to know how I can determine the current cursor position.

    Thanks in advance,
    Angela

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Textbox: Change and determine cursor position

    Is this a userform or controls on a worksheet?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Textbox: Change and determine cursor position

    Hi, This worked for me.!!
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Textbox: Change and determine cursor position

    If on a userform try setting EnterFieldBehavior to recall selection rather than selectall.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-04-2009
    Location
    Austria
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Textbox: Change and determine cursor position

    Hi,

    the textbox is on a userform and changing EnterFieldBehavior doesn't seem to change anything.

    Best wishes,
    Angela

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Textbox: Change and determine cursor position

    maybe you can post example as the following works for me.

    Userform with textbox and command button.

    With the following code
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1