Hi all,
i got this problem with my excel spreadsheet. I wanted to hide different row when i select different option from my dropdown list. At start, my B3 cell is empty therefore every row is shown. Thing work fine when i select any of the option(a,b,c,d). However when i changed my option from "a" to "b", row1 is still being hide. What can i do to refresh it?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("B3") = "a" Then
Sheets("Line").Rows("1").EntireRow.Hidden = True
ElseIf Range("B3") = "b" Then
Sheets("Line").Rows("2").EntireRow.Hidden = True
ElseIf Range("B3") = "c" Then
Sheets("Line").Rows("3").EntireRow.Hidden = True
ElseIf Range("B3") = "d" Then
Sheets("Line").Rows("4").EntireRow.Hidden = True
ElseIf Range("B3") = "e" Then
Sheets("Line").Rows("5").EntireRow.Hidden = True
Else
Sheets("Line").Rows("1:5").EntireRow.Hidden = False
End If
End Sub
Bookmarks