ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checkbox to hide or show rows (https://www.excelbanter.com/excel-programming/288584-re-checkbox-hide-show-rows.html)

Dave Peterson[_3_]

Checkbox to hide or show rows
 
I put a checkbox from the control toolbox toolbar on a worksheet.

I double clicked on it and used this sub:

Option Explicit
Private Sub CheckBox1_Click()
Me.Rows("10:12").Hidden = not Me.CheckBox1.Value
End Sub

If it's checked, then show them??? (or remove the Not to reverse the toggle)



wendy wrote:

I need help creating a checkbox that works like a toggle - if checked, a macro will run to show certain rows on sheet; if unchecked, the rows remain hidden or get hidden if they were showing.


--

Dave Peterson



All times are GMT +1. The time now is 03:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com