![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 76
|
Does anyone know what code I need to put into my form so that when hit command button 1, the cursor goes straight to combobox3. Also where do I put it? In the Exit code for command button 1 or what? Janie |
|
|
|
|
|
#2 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
combobox3 on sheet or form?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Posts: 76
|
On a userform
x |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
if the button is on the shet or userform (i.e. to load it).
right-click on the button, select view code. you should get Private Sub CommandButton1_Click() End Sub. Type: ComboBox1.SetFocus you should have Private Sub CommandButton1_Click() ComboBox1.SetFocus End Sub should do the trick!
__________________
"Have a good time......all the time" Ian Mac |
|
|
|
|
|
#5 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
Private Sub CommandButton1_Click()
ComboBox3.SetFocus End Sub And if you also want to combobox3 dropdown then Private Sub CommandButton1_Click() ComboBox3.SetFocus SendKeys "%{DOWN}" End Sub Regards |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Apr 2002
Posts: 76
|
Thanks guys, I owe you one
xx |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|