Hello, I am using the code below to hide all rows with the text "Solar" in the specified range. How can I modify this so that instead of looking for "Solar" it can be set to look in a cell that will be a data validation list. My goal is for the user to be able to show only the rows that have the word they selected from the list. I would like for it to change when ever the word is clicked on in the list if possible. I would also like for their to be an option to show all rows if the word "All" is selected.

If there is a faster way to accomplish what I am doing please let me know. As it is the code slows down my computer pretty badly.

Thanks!
Clayton

Sub HideRows()
 Dim R As Long
 Dim Rng As Range
    Set Rng = Worksheets("excel").Range("b7:b900")
   
     For R = Rng.Rows.Count To 1 Step -1
       If Not Rng.Cells(R, 1) = "Solar" Then Rng.Cells(R, 1).EntireRow.Hidden = True
     Next R
End Sub