Why does this happen or what is this telling me is wrong? copde in red bold underlined is apparently the cause of the freezing the second time i run my macro.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim RowCnt As Long
Dim BeginRow As Long
Dim EndRow As Long
Dim ChkCol As Long
Dim Rng As Range
Set Rng = Range("B10")
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Rng) Is Nothing Then Exit Sub
BeginRow = 11
EndRow = 280
ChkCol = 4
Application.ScreenUpdating = False
Application.EnableEvents = False
With Sheets("COSTS-Single Model Matrix")
For RowCnt = BeginRow To EndRow
.Cells(RowCnt, ChkCol).EntireRow.Hidden = (.Cells(RowCnt, ChkCol).Value = 0)
Next RowCnt
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim RowCnt As Long
Dim BeginRow As Long
Dim EndRow As Long
Dim ChkCol As Long
Dim Rng As Range
Set Rng = Range("B10")
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Rng) Is Nothing Then Exit Sub
BeginRow = 11
EndRow = 280
ChkCol = 4
Application.ScreenUpdating = False
Application.EnableEvents = False
With Sheets("COSTS-Single Model Matrix")
For RowCnt = BeginRow To EndRow
.Cells(RowCnt, ChkCol).EntireRow.Hidden = (.Cells(RowCnt, ChkCol).Value = 0)
Next RowCnt
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub