I have the following code hiding rows in a sheet, but the sheet is left with its dynamically created checkboxes still visible. Any ideas?
Private Sub SpinButton1_Change()
Application.ScreenUpdating = False
week = Me.Range("b1").Value
countcell = ActiveSheet.Range("A:A").Cells.SpecialCells(xlCellTypeConstants).Count
For i = 4 To countcell
pweek = Me.Cells(i, 2).Value 'load the planned week value
mycont = "ckboxPrintLabels" & i
If pweek <> week Then
CheckBoxes(mycont).Visible = False
Rows(i).EntireRow.Hidden = True
MsgBox mycont & "= " & ActiveSheet.CheckBoxes(mycont).Visible
Else
Rows(i).EntireRow.Hidden = False
ActiveSheet.CheckBoxes(mycont).Visible = True
End If
k = i
Next i
Application.ScreenUpdating = True
End Sub
So currently I have ckboxPrintLabels4 thru to 16 on the sheet. They fail to change visibility. Although the msgbox reports that they have visibility at false...???