Set the cursor position in a combobox upon opening
Solved
Landry85
Posted messages
96
Status
Member
-
Landry85 Posted messages 96 Status Member -
Landry85 Posted messages 96 Status Member -
Good evening,
Impossible to find a code that works, could someone have that?
I would like, firstly, that when I open my workbook, the cursor (by "cursor" I mean the blinking bar, not the mouse arrow, sorry for the precision, but I'm not sure I'm using the right terms) positions itself in my combobox2.
Then, secondly, after selecting one option button or another, that the cursor positions itself in the combobox1.
Thank you in advance for your help
Configuration: Windows / Chrome 60.0.3112.113
Impossible to find a code that works, could someone have that?
I would like, firstly, that when I open my workbook, the cursor (by "cursor" I mean the blinking bar, not the mouse arrow, sorry for the precision, but I'm not sure I'm using the right terms) positions itself in my combobox2.
Then, secondly, after selecting one option button or another, that the cursor positions itself in the combobox1.
Thank you in advance for your help
Configuration: Windows / Chrome 60.0.3112.113
5 answers
-
For the second time, I found:
If OptionButton5.Value = True Then Me.ComboBox1.Activate
More than the first one :-) -
Hello,
a proposal:Private Sub OptionButton1_Click() ComboBox1.SetFocus End Sub Private Sub OptionButton2_Click() ComboBox1.SetFocus End Sub Private Sub UserForm_Initialize() ComboBox2.SetFocus End Sub
-
I just tested it:
Private Sub WorkBook_Activate()
Me.ComboBox2.Select
Me.ComboBox2.Activate
End Sub
Doesn't work any better... :-(-
-
- https://www.cjoint.com/ to create a link and paste it here
-
-
-
I succeeded by writing:
Private Sub Workbook_Open() With Worksheets("Recherche").ComboBox1 .Select .Activate End With End Sub
in the ThisWorkbook sheet under the Sheet 5 Open event.