Connecting dropdown list to a search button that jumps to a cell

kyceeq

New Member
Joined
Aug 24, 2023
Messages
8
Office Version
  1. 2021
Platform
  1. Windows
Hello everyone. I am a newbie with Excel VBA and I am having trouble connecting my dropdown list to a search button. This is how i want it to work. I have a couple of options in my dropdown list and I want the user to be able to select any of the options and click the search button. This button then jumps to the part of the same worksheet where the information is display. There are three sections for that information. I want the other unwanted sections to hide automatically and only displays the information needed.

please hoe do I go about this. I have tried literally everything i can think of... thank you
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
What you're asking for is very doable, but we'd need a lot more information to get the ball rolling. Ideally, provide a copy of your sheet using the XL2BB - Excel Range to BBCode or alternatively, share a copy of your workbook (sensitive data hidden/disguised) via Google Drive, Dropbox or similar file sharing platform. Plus a detailed explanation of which ranges you want hidden/visible according to which selection of the dropdown.
 
Upvote 0
Ok..thank you for your swift reply . I hope photos will suffice....

The first photo shows the menu im creating and the dropdown list.

the second photo shows all the search results.

But i want to be able to select the options on the dropdown list and hit the search button and the search button displays the results of that specific selection and hides the rest as displayed in photo 3
 

Attachments

  • Polish_20230825_072404680.png
    Polish_20230825_072404680.png
    142.7 KB · Views: 17
  • Screenshot (22).png
    Screenshot (22).png
    160.7 KB · Views: 16
  • Screenshot (26).png
    Screenshot (26).png
    147.9 KB · Views: 16
Upvote 0
You can adjust the ranges (row numbers) if they're not quite right. Attach the two macros to the relevant buttons.

VBA Code:
Option Explicit
Sub SEARCH_Button()
    Dim s As String
    Application.ScreenUpdating = False
    With ActiveSheet
        .Range("A19:A50").EntireRow.Hidden = True
        s = .Range("M10").Value2
        Select Case s
            Case "FIRST TERM"
                .Range("A19:A28").EntireRow.Hidden = False
            Case "SECOND TERM"
                .Range("A30:A39").EntireRow.Hidden = False
            Case "THIRD TERM"
               .Range("A41:A50").EntireRow.Hidden = False
        End Select
    End With
    Application.ScreenUpdating = True
End Sub

Sub CLEAR_Button()
    ActiveSheet.Range("A19:A50").EntireRow.Hidden = False
End Sub
 
Upvote 0
Thank you so much Kevin. It worked seamlessly. I'm so glad to have joined this platform. Do you give personal classes?
 
Upvote 0
Thank you so much Kevin. It worked seamlessly. I'm so glad to have joined this platform. Do you give personal classes?
Happy to help and thanks for the feedback 👍 but no personal classes I'm afraid.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,952
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top