I have a worksheet where column A data changes when you select a different drop down option (ex - hours, weekdays, months, etc.). But I don't want the blank rows to show. For example, there are currently 53 rows for the 53 weeks in a year, but when I switch the data to Weekdays I want it to only show the 7 rows for the 7 weekdays. I don't want this to be a filter but a recurring VBA code that automatically updates when the data type changes (cell B5). I've attached a picture and the current code that I'm using, but the code isn't changing automatically.
Sub HURows()
BeginRow = 9
EndRow = 60
ChkCol = 1
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = 0 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Sub HURows()
BeginRow = 9
EndRow = 60
ChkCol = 1
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = 0 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub