Hello all!
I hope to find you well. Once again, this newbie to VBA will ask for your help.
I would like to hide certain rows, based on a form control checked or not checked. In sheet "Part1", one will select, in column A, which Products they own (can be more than one).
On the sheet "Part2", the rows related to the product that were not "checked" should be hidden.
I have tried to use this code. However, I believe that select case is not the most suitable for what I want, as it does not work.:
You can find the excel file here, if it helps: question.xlsm
Thank you in advance!
I hope to find you well. Once again, this newbie to VBA will ask for your help.
I would like to hide certain rows, based on a form control checked or not checked. In sheet "Part1", one will select, in column A, which Products they own (can be more than one).
On the sheet "Part2", the rows related to the product that were not "checked" should be hidden.
I have tried to use this code. However, I believe that select case is not the most suitable for what I want, as it does not work.:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("AC5, AC6, AC7, AC8")) Is Nothing Then Exit Sub
ActiveSheet.Unprotect Password:="123"
Application.ScreenUpdating = False
With Sheets("Part2")
Select Case Target.Address
Case "$AC$5"
Select Case Target.Value
Case Is = 0
.Rows("5").EntireRow.Hidden = True
End Select
Case "$AC$6"
Select Case Target.Value
Case Is = 0
.Rows("6").EntireRow.Hidden = True
End Select
Case "$AC$7"
Select Case Target.Value
Case Is = 0
.Rows("7").EntireRow.Hidden = True
End Select
Case "$AC$8"
Select Case Target.Value
Case Is = 0
.Rows("8").EntireRow.Hidden = True
End Select
End Select
ActiveSheet.Protect Password:="123"
Application.ScreenUpdating = True
End With
End Sub
You can find the excel file here, if it helps: question.xlsm
Thank you in advance!