Frank Freese
asked on
Problem with reloading combo box
Folks,
In my workbook there are numerous worksheets. I navigate between them using a combo box for the first tab (Main Menu) and command buttons on the first tab and corresponding worksheet tabs to return to a designated home position.
Here's the code for the combo box:
Private Sub cboTextFunctions_Change()
Application.Goto Range("C" & cboTextFunctions.ListIndex + 60)
End Sub
This works fine the first time. The code below this returns me to the home position of the combo box. If I tried to immediately select the range I just selected nothing happens.
I have to select a different combo box option before I can return to the one I first selected. Is there a way to "refresh the combo box? I've attahced the workbook
Private Sub Home63_Click()
Sheets("Menu").Activate
Sheets("Menu").Range("K2:M 2").Select
End Sub
Function-and-Formulas-for-Excel-.xlsm
In my workbook there are numerous worksheets. I navigate between them using a combo box for the first tab (Main Menu) and command buttons on the first tab and corresponding worksheet tabs to return to a designated home position.
Here's the code for the combo box:
Private Sub cboTextFunctions_Change()
Application.Goto Range("C" & cboTextFunctions.ListIndex
End Sub
This works fine the first time. The code below this returns me to the home position of the combo box. If I tried to immediately select the range I just selected nothing happens.
I have to select a different combo box option before I can return to the one I first selected. Is there a way to "refresh the combo box? I've attahced the workbook
Private Sub Home63_Click()
Sheets("Menu").Activate
Sheets("Menu").Range("K2:M
End Sub
Function-and-Formulas-for-Excel-.xlsm
You should have that in the Click event of cboTextFunctions not the Change event.
ASKER
Tried that - problem remains the same
Okay. Please explain again step by step with actual selections what you expect to happen.
ASKER
No problem.
When I select an item in my conbo box it does take me directly to that location. If I select the Home command button it returns me to where I want to go. Now, if I immediately reselected the same item the second time from the same combo box, nothing happens.
When I select an item in my conbo box it does take me directly to that location. If I select the Home command button it returns me to where I want to go. Now, if I immediately reselected the same item the second time from the same combo box, nothing happens.
Private Sub cboTextFunctions_Click()
Application.Goto Range("C" & cboTextFunctions.ListIndex + 60)
cboTextFunctions.ListIndex = -1
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Let me also suggest that you select cell G10 and then choose 'Freeze Panes' from the View tab and then 'Freeze Panes' from the drop down.
Two things:
1. In order for my code to work properly you need to remove the cboTextFunctions_Change code, and
2. If you freeze the panes as I suggested you may decide that you don't need the 'Home' buttons
1. In order for my code to work properly you need to remove the cboTextFunctions_Change code, and
2. If you freeze the panes as I suggested you may decide that you don't need the 'Home' buttons
ASKER
You NAILED it! Many thanks
You're welcome and I'm glad I was able to help again. Did you try freezing the panes?
Select the 'About Me' tab in my profile and you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2013
Select the 'About Me' tab in my profile and you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2013
ASKER
Interesting tips - I've considered freezing panes and will first finish this project. My youngest son is not very Excel literate and this should help him a lot.
Again, thanks. I'll follow-up
Again, thanks. I'll follow-up
Here is your project with the panes frozen just in case you want to take a look.
Q-28225081.xlsm
Q-28225081.xlsm
BTW, and this is important, click the "Date and Time Function" and then the "Basic Financial Functions" button. Do that several times. Do the buttons change size? If so you are experiencing one of the problems with using ActiveX controls on a sheet. For a solution see this article.
ASKER
thanks
ASKER
I've looked at what you proposed. I would like to open a new question. In this question I would like the get rid of the Home button and when I select from a combo box have the selection appear at the top of the row that was frozen. Possible?
Yes.