Enabling a command button once a item has been select from a list box

Folks,
In the attached workbook, worksheet labeled "Menu" I have two list boxes. I also have a command button that's been not been enabled called "GoTo Selection". I would like to enable the GoTo Selection command button once I select an item from the Topics list but not until asking the user "You have elected 'xxxxxxx" Topic. Are you sure (Y/N)". If no then do nothing, else enable the GoTo Selection command button and putting the focus on that button.
Function-and-Formulas-for-Excel-.xlsm
Frank FreeseAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FamousMortimerCommented:
Hi,

Try adding this to the Menu worksheet code.

    If lstTopic.Value <> vbNullString Then
        If MsgBox("You have elected " & lstTopic.Text & "." & vbCrLf & "Are you sure?", vbYesNo + vbQuestion, "Confirm Selection") = vbYes Then
            GoToSelection.Enabled = True
        Else
            lstTopic.MultiSelect = fmMultiSelectMulti
            lstTopic.ListIndex = -1
            lstTopic.MultiSelect = fmMultiSelectSingle
        End If
    Else
        GoToSelection.Enabled = False
        GoToSelection.Select
    End If
End Sub

Open in new window

0
Frank FreeseAuthor Commented:
What event?
0
FamousMortimerCommented:
lol sorry, it must have gotten cut off during my copy/paste...

Private Sub lstTopic_Click()
    If lstTopic.Value <> vbNullString Then
        If MsgBox("You have elected " & lstTopic.Text & "." & vbCrLf & "Are you sure?", vbYesNo + vbQuestion, "Confirm Selection") = vbYes Then
            GoToSelection.Enabled = True
        Else
            lstTopic.MultiSelect = fmMultiSelectMulti
            lstTopic.ListIndex = -1
            lstTopic.MultiSelect = fmMultiSelectSingle
        End If
    Else
        GoToSelection.Enabled = False
        GoToSelection.Select
    End If
End Sub

Open in new window

0
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Martin LissOlder than dirtCommented:
I'll have a complete solution for you shortly.
0
Frank FreeseAuthor Commented:
Look like you nailed it! Appreciate it
0
Frank FreeseAuthor Commented:
Thank MartinLiss - I'll check your out before awarding final points
0
Martin LissOlder than dirtCommented:
I'm sorry but I didn't completely read the question and now having done that I don't understand why you want to ask the user that question. It would annoy me if I had to answer yes every time.
0
Frank FreeseAuthor Commented:
Let me get back with you after my meeting and I'll explain
0
Martin LissOlder than dirtCommented:
In any case here's my solution without the question. Note that at least in the workbook I'm using, the rows that represent the functions for Basic Statistical Functions and Mathematical Functions on the Menu sheet are missing and row 142 appears to be colored incorrectly.

All the changes I made are annotated like this

        '******* Q2 Start *******
        intCatFactor = 10
        '******* Q2 End *********

Open in new window

Q-28239051.xlsm
0
Frank FreeseAuthor Commented:
I'm having a difficult time opening the file. It maybe the workstation here at work so I'll try at home this evening. Excedl crashes everytime I click on a Topic - wierd?
0
FamousMortimerCommented:
With my solution or Martin's?
0
Frank FreeseAuthor Commented:
Martin's
0
Martin LissOlder than dirtCommented:
It's doing to me too now. Let me see if I did something wrong before I saved and posted it.
0
Martin LissOlder than dirtCommented:
This should be better.
Q-28239051.xlsm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Frank FreeseAuthor Commented:
Much much better - I really like it.
0
Frank FreeseAuthor Commented:
Two great solutions - Martin you got ahead of me but that's OK. Great job folks
0
Martin LissOlder than dirtCommented:
As always you're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013
0
Frank FreeseAuthor Commented:
Martin,
I have looked for your code for a feature on the open worksheet of my project where I can click on Go To Select command button or on the Topic or Description. The worksheet has the three sections Category, Topic and Description with Topic being a list box. I would like to post a question for you, since you're the most knowledage of what you did where I can also have the option of double clicking on the Topic and go to the Topic worksheet. Are you OK with me posting the question for you?
Frank
0
Martin LissOlder than dirtCommented:
The moderators don't allow question to be directed at a single person so just post your question and if I see it I'll try to answer it, but if I don't then I'm sure someone else will.
0
Frank FreeseAuthor Commented:
I understand...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.