Hello all
I have a dropdown list with 6 options (Cell link H5). If the user of my file chooses option 6, line 23 and 24 of my input sheet should be unhidden. If the user chooses the options 1 to 5, line 23 and 24 should be hidden. How can this be done? I have already a code but it doesn't work!
I made 2 macros which should be running automatically, depending the choose in the dropdownlist:
Sub UnhideNameOfDisease()
Sheets("Input").Activate
If Range("H5").Value = 6 Then
Rows("23:25").Hidden = False
End If
End Sub
Sub HideNameOfDisease()
Sheets("Input").Activate
If Range("H5").Value < 6 Then
Rows("23:25").Hidden = True
End If
End Sub
This macro is to run one of them:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address <> "$H$5" Then Exit Sub
Select Case Target.Value
Case "1"
Call HideNameOfDisease
Case "2"
Call HideNameOfDisease
Case "3"
Call HideNameOfDisease
Case "4"
Call HideNameOfDisease
Case "5"
Call HideNameOfDisease
Case "6"
Call UnhideNameOfDisease
Case Else
End Select
End Sub
Thanxs for answers!!!
Greets
Bookmarks