Hi All
(I know very little about VBA)
I commented out code as you can see below but the code is still working. I closed Excel and reopened with no change. I only have 1 workbook open and I know I'm looking at the right code. The code I'm referring to is below the commented 'Hide Rows--------------------
When I make a change in G2, the rows are being hidden despite the commented code. I know this can't be possible but I can't think of why this is happening.
(I know very little about VBA)
I commented out code as you can see below but the code is still working. I closed Excel and reopened with no change. I only have 1 workbook open and I know I'm looking at the right code. The code I'm referring to is below the commented 'Hide Rows--------------------
When I make a change in G2, the rows are being hidden despite the commented code. I know this can't be possible but I can't think of why this is happening.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect "********" '(Auto unlock sheet)
'(Calculates sheet when changes are made within the range)
Worksheets("Rack").Calculate
Range("bm:bm").AutoFilter 1, "<>0"
Application.Calculation = xlCalculationManual
For Each Cll In Range("A1:A1300,F1:F1300,G1:G1300,I1:I1300,K1:K1300,L1:L1300,M1:M1300")
For Each TCll In Target
If Cll.Address = TCll.Address Then
ThisWorkbook.Sheets("Multi Build").Calculate
ThisWorkbook.Sheets("Rack").Calculate
'ActiveSheet.Protect "********" '(Auto locks sheet)
Exit Sub
End If
Next TCll
Next Cll
'Hide rows---------------------------------------------------------------
'ActiveSheet.Unprotect "********"
If Not Intersect(Target, Range("G2")) Is Nothing Then '(Rack#1x24)
If Target.Count = 1 Then
'If Range("BK3").Value = "2" Then
' Rows("30:53").EntireRow.Hidden = True
'ElseIf Range("BK3").Value <> "3" Then
'Rows("6:53").EntireRow.Hidden = False
'End If
End If
End If
If Not Intersect(Target, Range("G2")) Is Nothing Then '(Rack#1x12)
If Target.Count = 1 Then
'If Range("BK3").Value = "1" Then
' Rows("18:53").EntireRow.Hidden = True
'End If
End If
End If
' ActiveSheet.Protect "********"
End Sub
Last edited by a moderator: