In have a ComboBox1 in a sheet and once the user selects the value from this ComboBox1 the value is displayed on cell E5.
Is there a better way, as I am trying to hide the rows and unhide the rows with the selection of ComboBox1. In ComboBox1 there more than 20 values
currently I have the below code.
Is there a better way, as I am trying to hide the rows and unhide the rows with the selection of ComboBox1. In ComboBox1 there more than 20 values
currently I have the below code.
VBA Code:
Private Sub ComboBox1_Change()
Sheets("Summarised SiteWise").Range("E5").Value = ComboBox1.Value
If Sheets("Summarised SiteWise").Range("E5").Value = "All" Then
Worksheets("Summarised SiteWise").Rows("9:100").EntireRow.Hidden = False
End If
If Sheets("Summarised SiteWise").Range("E5").Value = "Alight Total" Then
Worksheets("Summarised SiteWise").Rows("9:9").EntireRow.Hidden = False
Worksheets("Summarised SiteWise").Rows("10:40").EntireRow.Hidden = True
End If
If Sheets("Summarised SiteWise").Range("E5").Value = "Aon Hewitt Total" Then
Worksheets("Summarised SiteWise").Rows("10:10").EntireRow.Hidden = False
Worksheets("Summarised SiteWise").Rows("9:9").EntireRow.Hidden = True
Worksheets("Summarised SiteWise").Rows("11:10").EntireRow.Hidden = True
End If
End Sub