Hello!
I hope to find you well
I would like to know if there is any code in VBA, that allows hide rows if they are empty. In my case, I would like to hide rows from 40 to 327, if the rows are empty (or if column A of that row is empty).
Also, I already have this code in the sheet I am talking about:
I hope to find you well
I would like to know if there is any code in VBA, that allows hide rows if they are empty. In my case, I would like to hide rows from 40 to 327, if the rows are empty (or if column A of that row is empty).
Also, I already have this code in the sheet I am talking about:
SQL:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("D10,H20")) Is Nothing Then Exit Sub
ActiveSheet.Unprotect Password:="123"
Application.ScreenUpdating = False
With Sheets("Sheet1")
Select Case Target.Address
Case "$D$10"
Select Case Target.Value
Case Is = 1, 2
.CheckBoxes("Check Box 7").Visible = False
.CheckBoxes("Check Box 8").Visible = False
.Rows("33:34").EntireRow.Hidden = False
Case Is = 3, 4
.CheckBoxes("Check Box 9").Visible = True
.CheckBoxes("Check Box 10").Visible = True
.Rows("33:34").EntireRow.Hidden = True
.Rows("31:32").EntireRow.Hidden = False
End Select
Case "$H$20"
Select Case Target.Value
Case "PRODUCT A"
.CheckBoxes("Check Box 5").Visible = False
.CheckBoxes("Check Box 6").Visible = False
.CheckBoxes("Check Box 1").Visible = True
.CheckBoxes("Check Box 2").Visible = True
.Rows("21:22").EntireRow.Hidden = True
Case "PRODUCT B"
.CheckBoxes("Check Box 5").Visible = True
.CheckBoxes("Check Box 6").Visible = True
.CheckBoxes("Check Box 1").Visible = True
.CheckBoxes("Check Box 2").Visible = True
.Rows("21:22").EntireRow.Hidden = False
End Select
End Select
End With
ActiveSheet.Protect Password:="123"
Application.ScreenUpdating = True