Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Panel

0

    Hello, can someone explain to me how is the search panel in workbook made? https://www.youtube.com/watch?v=zjlLeoSqtHA

    The one where he inputs the word he wants to search and field. Also, how can I modify the field values from ID and Name, to only one option Signal Name?

Answer
Discuss

Answers

0
Selected Answer

Squishy

The "search panel" used in Don's tutorial Fast Search Multiple Workbooks in Excel with a File Picker - VBA Macros (where the files are) is created using the techniques explained in another of his tutorials here: Idiot-Proof Forms in Excel - Part 1 - Formatting (and I suggest you look at the other tutorials in that series).

To search on a single value, we can eliminate the Field cell on the worksheet and within the code we can replace this portion of the code:

'Get user input

searchValue = dashboard.Range("C4").Value

fieldValue = dashboard.Range("E4").Value



'Clear Dashboard

'Call Clear_Data()



'Figure out by which field we will search.

If (fieldValue = "ID") Then

    searchField = 1

ElseIf (fieldValue = "Name") Then

    searchField = 2

End
with the simplified 
'Get user input
searchValue = dashboard.Range("C4").Value

'Clear Dashboard
'Call Clear_Data()

'Specify which field we will search.
searchField = 2
where I've picked data column 2 -Name- to fit in with the test files on the Tutorial). In your case you'll design your form to suit your data (and have Signal named as your search criteria on the worksheet).

I've attached a revised tutorial .xlsm file to show that (including the reduced code above) plus the original test data files from the tutorial.

Hope this helps.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login