I got this code from here to use on my sheet.
Sub Tuesday_Update()
Sheets("Tuesday").Unprotect Password:="123"
BeginRow = 1
EndRow = 745
ChkCol = 3
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = 0 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
Next RowCnt
Sheets("Tuesday").Protect Password:="123"
End Sub
Column C is set to use 1's and 0's as the trigger. Once a selection is made then that column for that section changes to 1's or 0's.
EXAMPLE: C6:C31 holds 25 potential spots for classes, but the class may only allow 12 people. So if the person picks that class, then C17:C31 changes to 0's and should hide with the code, leaving C1:C16 visible. The next section has a different selectable class, C38:C62 and that might have a class that only allows 4 people, so while there is 25 openings, after C42:C62 will change to 0's and should hide, leaving C33:C41 visible, along with the previous. In a nut shell hide any row with a 0 in column C.
The issue I am having is that is just loops and never ends...this should be a super-fast check and update, but is just hanging, and when I debug its the "End If" section it complains about.
Can someone help me trouble shoot this.
Thanks,
Sub Tuesday_Update()
Sheets("Tuesday").Unprotect Password:="123"
BeginRow = 1
EndRow = 745
ChkCol = 3
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = 0 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
Next RowCnt
Sheets("Tuesday").Protect Password:="123"
End Sub
Column C is set to use 1's and 0's as the trigger. Once a selection is made then that column for that section changes to 1's or 0's.
EXAMPLE: C6:C31 holds 25 potential spots for classes, but the class may only allow 12 people. So if the person picks that class, then C17:C31 changes to 0's and should hide with the code, leaving C1:C16 visible. The next section has a different selectable class, C38:C62 and that might have a class that only allows 4 people, so while there is 25 openings, after C42:C62 will change to 0's and should hide, leaving C33:C41 visible, along with the previous. In a nut shell hide any row with a 0 in column C.
The issue I am having is that is just loops and never ends...this should be a super-fast check and update, but is just hanging, and when I debug its the "End If" section it complains about.
Can someone help me trouble shoot this.
Thanks,