jeudi 1 novembre 2018

Unhide/Hide rows in excel with a form checkbox

I have a form created in excel which has rows [10:48] hidden and I want to make so that when you click a checkbox rows [10:48] are unhidden. I assigned a macro to the checkbox and using this formula:

Private Sub CheckBox45_Click()

  If CheckBox45 = True Then

  [10:48].EntireRow.Hidden = False

  Else: [10:48].EntireRow.Hidden = True

End If

End Sub

When I click the checkbox nothing happen, but when I unhide the rows and click the checkbox it hides the rows. Which makes me think that only one of the actions is working. Is there a way to fix this?

Thanks in advance for the help.

Don't know if this matters but the form checkbox is in column D row 6




Aucun commentaire:

Enregistrer un commentaire