Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm
I have a UserForm that has a drop box with all of the worksheet names in the
drop box. When the user clicks the worksheet name, that worksheet becomes the active sheet on the screen. However, the cursor focus stays in the drop box and I want the focus and the cursor to go the the worksheet. The UserForm should lose the focus and Excel and the worksheet should get the focus. NO LUCK! Please help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm
I created a small userform with a combobox and a commandbutton (to cancel) on
them. This code showed the form: Option Explicit Sub testme() UserForm1.Show vbModeless End Sub This code was behind the userform: Option Explicit Private Sub ComboBox1_Change() On Error Resume Next Sheets(Me.ComboBox1.Value).Select If Err.Number < 0 Then MsgBox "Error Selecting sheet: " & Me.ComboBox1.Value Err.Clear End If On Error GoTo 0 AppActivate Application.Caption End Sub Private Sub CommandButton1_Click() Unload Me End Sub Private Sub UserForm_Initialize() Dim wks As Object For Each wks In ActiveWorkbook.Sheets Me.ComboBox1.AddItem wks.Name Next wks End Sub ======== Another idea would be to use a floating toolbar. If you want to look into that, here's a link to an old post. http://groups.google.com/groups?thre...1C74%40msn.com Steve wrote: I have a UserForm that has a drop box with all of the worksheet names in the drop box. When the user clicks the worksheet name, that worksheet becomes the active sheet on the screen. However, the cursor focus stays in the drop box and I want the focus and the cursor to go the the worksheet. The UserForm should lose the focus and Excel and the worksheet should get the focus. NO LUCK! Please help. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Access from add_in userform to main template userform.... | Excel Programming | |||
Linking userform to userform in Excel 2003 | Excel Programming | |||
Userform inside another userform | Excel Programming | |||
userform | Excel Programming |