Tab to textbox position

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi
Is it possible to tab to a position on a user form textbox ?

Example
Currently in TextBox1 then I use the tab button.
Now I’m in Textbox2

In textbox 2 will be a value of which I would like to be in position 2, make sense ?

Textbox2 value say ABCD
When I tab from textbox 1 I need to be between A & B

Thanks
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
try
VBA Code:
Private Sub TextBox2_Enter()
    With Me.TextBox2
        .EnterFieldBehavior = 1
        .Value = "ABCD"
        .SelStart = 1
    End With
End Sub
 
Upvote 0
Solution
@NoSparks

Just on a side note.
As opposed to using ABCD what if i wanted to use "" between the 2 that are already there ?
S0 """"

I did try it but after the value was entered then i started to type the cursor jumped outside of the last "
 
Upvote 0
Not sure what you have existing in the textbox
but think this is what you're asking about
VBA Code:
Private Sub TextBox2_Enter()
    With Me.TextBox2
        .EnterFieldBehavior = 1
        .Value = """"""
        .SelStart = 1
    End With
End Sub
 
Upvote 0
Morning,
I tab to the Textbox in question but i am unable to type,i mean i type some text but nothing happens & i only see the quote marks
 
Upvote 0
Works for me on my small test setup.
Won't try guessing at what your issue is.
If you made a file available and say what you're doing when this happens I'd have a look.
 
Upvote 0
As every its on a sheet with plenty of other stuff & my process for just sending 1 file here is a pain.

See if anything wrong here please,otherwise i will have to leave it
 

Attachments

  • EaseUS_2023_12_19_16_37_58.jpg
    EaseUS_2023_12_19_16_37_58.jpg
    64.7 KB · Views: 5
  • EaseUS_2023_12_19_16_38_06.jpg
    EaseUS_2023_12_19_16_38_06.jpg
    8.9 KB · Views: 5
Upvote 0

Forum statistics

Threads
1,215,123
Messages
6,123,183
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top