Hiding rows when validation list is changed
Solved/Closed
Related:
- Hiding rows when validation list is changed
- How to change your best friends list on snapchat to 3 - Guide
- Display two columns in data validation list but return only one - Guide
- Counter strike 1.6 cheats list - Guide
- All contact number list with name - Guide
- Amd crossfire compatibility list - Guide
2 responses
Hi Danny,
Implement the following code by right clicking the sheet tab and selecting view code:
To display all rows again, delete the content of cell A2.
The code will be activated whenever a change to the sheet is made.
Does this suit your needs?
Best regards,
Trowa
Implement the following code by right clicking the sheet tab and selecting view code:
Private Sub Worksheet_Change(ByVal Target As Range) If Range("A2") = "X" Then Rows("3:39").EntireRow.Hidden = True Rows("42:77").EntireRow.Hidden = False End If If Range("A2") = "Rose" Then Rows("42:77").EntireRow.Hidden = True Rows("3:39").EntireRow.Hidden = False End If If Range("A2") = "" Then Rows("42:77").EntireRow.Hidden = False Rows("3:39").EntireRow.Hidden = False End If End Sub
To display all rows again, delete the content of cell A2.
The code will be activated whenever a change to the sheet is made.
Does this suit your needs?
Best regards,
Trowa
Thanks. It worked great. For some reason, the view/cursor will go to the very bottom of my excel sheet rows 126:127, everytime I choose in A52. It does hide the 59:61, but the view will go to 126:127.
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A52") = "Port-Side Intake" Then
Rows("59:61").EntireRow.Hidden = True
Else
Rows("59:61").EntireRow.Hidden = False
End If
If Range("A52") = "Port-Side Exhaust" Then
Rows("56:58").EntireRow.Hidden = True
Else
Rows("56:58").EntireRow.Hidden = False
End If
If Range("A122") = "Port-Side Intake" Then
Rows("124:125").EntireRow.Hidden = True
Else
Rows("124:125").EntireRow.Hidden = False
End If
If Range("A122") = "Port-Side Exhaust" Then
Rows("126:127").EntireRow.Hidden = True
Else
Rows("126:127").EntireRow.Hidden = False
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A52") = "Port-Side Intake" Then
Rows("59:61").EntireRow.Hidden = True
Else
Rows("59:61").EntireRow.Hidden = False
End If
If Range("A52") = "Port-Side Exhaust" Then
Rows("56:58").EntireRow.Hidden = True
Else
Rows("56:58").EntireRow.Hidden = False
End If
If Range("A122") = "Port-Side Intake" Then
Rows("124:125").EntireRow.Hidden = True
Else
Rows("124:125").EntireRow.Hidden = False
End If
If Range("A122") = "Port-Side Exhaust" Then
Rows("126:127").EntireRow.Hidden = True
Else
Rows("126:127").EntireRow.Hidden = False
End If
End Sub