Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just to add...
Since this code is behind a worksheet, the unqualified ranges (rows(14:14)) will belong to the sheet that owns the code. And since you can only select a range on the activesheet, your code fails. You could have used: If CheckBox3 = True Then with sheets("Output") .select .rows("14:14").select selection.entirerow.hidden = false end with else... But it's better not to select anything in your code. The resulting code will be much easier to read. I would have used something like: Private Sub checkbox3_Click() workSheets("Output").Rows(14).EntireRow.Hidden = Not (CheckBox3.Value) End Sub BJ wrote: I'd like to hide rows in tab 'Output' based on a checkbox in tab 'Input' ... I've tried the code below but am getting the Run-time erro 1004 - Select Method of Range class failed. So obviously I'm not calling this correctly. Any help? Thanks. Private Sub checkbox3_Click() If CheckBox3 = True Then Sheets("Output").Select Rows("14:14").Select Selection.EntireRow.Hidden = False End If If CheckBox3 = False Then Sheets("Output").Select Rows("14:14").Select Selection.EntireRow.Hidden = True End If End Sub -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
use checkbox to hide rows | Excel Discussion (Misc queries) | |||
Hide & Unhide with a Checkbox | Excel Programming | |||
hide rows from checkbox | Excel Programming | |||
Checkbox to hide and unhide rows Please. | Excel Worksheet Functions | |||
Checkbox to hide or show rows | Excel Programming |