checkbox to hide/show row

  • Thread starter Thread starter emanuel.darlea
  • Start date Start date
E

emanuel.darlea

hi,
if anyone can help it'd be appreciated. Here is what I'd like to
accomplish:

on sheet3 I want to insert a Category with checkboxes next to each
item

On sheet one I want to hide/show categories that have been
checked...and hide the rows if I uncheck them.

thank u for your input
 
Hi

The code below would be one way of doing it. Run this code in the
worksheet with the checkboxes, it will control the hiding of rows 1-5
on sheet1.

Option Explicit
Dim WkSh As Worksheet

Private Sub CheckBox1_Click()

Set WkSh = ThisWorkbook.Sheets("Sheet1")

If CheckBox1.Value = False Then

WkSh.Rows("1:5").EntireRow.Hidden = True

Else

If WkSh.Rows("1:5").Hidden = True Then

WkSh.Rows("1:5").EntireRow.Hidden = False

End If

End If

End Sub

Hope this helps

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top