Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using the following to hide rows from a checkbox. My question is how can
i get it to unhide the rows if the checkbox is unmarked? Private Sub CB1_Click() For a = 10 To 30 Cells(a, 1).Select Selection.EntireRow.Hidden = True Next a End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
check the checkbox status
if cb1.value = true then // code for hide else // code for unhide endif ===== * ===== * ===== * ===== Daniel CHEN www.Geocities.com/UDQServices Free Data Processing Add-in< ===== * ===== * ===== * ===== "Qaspec" wrote in message ... I'm using the following to hide rows from a checkbox. My question is how can i get it to unhide the rows if the checkbox is unmarked? Private Sub CB1_Click() For a = 10 To 30 Cells(a, 1).Select Selection.EntireRow.Hidden = True Next a End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Qaspec,
Try: Private Sub CB1_Click() Range("A10:A30").EntireRow.Hidden = CB1.Value End Sub --- Regards, Norman "Qaspec" wrote in message ... I'm using the following to hide rows from a checkbox. My question is how can i get it to unhide the rows if the checkbox is unmarked? Private Sub CB1_Click() For a = 10 To 30 Cells(a, 1).Select Selection.EntireRow.Hidden = True Next a End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In addition to those rows i would also like to hide/unhide row 4 on sheet2.
How do i add that into the sub? "Norman Jones" wrote: Hi Qaspec, Try: Private Sub CB1_Click() Range("A10:A30").EntireRow.Hidden = CB1.Value End Sub --- Regards, Norman "Qaspec" wrote in message ... I'm using the following to hide rows from a checkbox. My question is how can i get it to unhide the rows if the checkbox is unmarked? Private Sub CB1_Click() For a = 10 To 30 Cells(a, 1).Select Selection.EntireRow.Hidden = True Next a End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just add the sheet reference:
Sheets("Sheet2").Rows(4).EntireRow.Hidden = CB1.Value -- rand451 "Qaspec" wrote in message ... In addition to those rows i would also like to hide/unhide row 4 on sheet2. How do i add that into the sub? "Norman Jones" wrote: Hi Qaspec, Try: Private Sub CB1_Click() Range("A10:A30").EntireRow.Hidden = CB1.Value End Sub --- Regards, Norman "Qaspec" wrote in message ... I'm using the following to hide rows from a checkbox. My question is how can i get it to unhide the rows if the checkbox is unmarked? Private Sub CB1_Click() For a = 10 To 30 Cells(a, 1).Select Selection.EntireRow.Hidden = True Next a End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this. (note that there is no selection needed)
Private Sub CheckBox1_Click() If CheckBox1 = True Then Range(Rows(10), Rows(30)).EntireRow.Hidden = True ElseIf CheckBox1 = False Then Range(Rows(10), Rows(30)).EntireRow.Hidden = False End If End Sub -- rand451 "Qaspec" wrote in message ... I'm using the following to hide rows from a checkbox. My question is how can i get it to unhide the rows if the checkbox is unmarked? Private Sub CB1_Click() For a = 10 To 30 Cells(a, 1).Select Selection.EntireRow.Hidden = True Next a End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just change the following line
Selection.EntireRow.Hidden = CB1.Value Alok Joshi "Qaspec" wrote: I'm using the following to hide rows from a checkbox. My question is how can i get it to unhide the rows if the checkbox is unmarked? Private Sub CB1_Click() For a = 10 To 30 Cells(a, 1).Select Selection.EntireRow.Hidden = True Next a End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Color alternate rows when after hiding selected rows | Excel Worksheet Functions | |||
Hiding Specific Rows Based on Values in Other Rows | Excel Worksheet Functions | |||
Hiding a ComboBox with a Checkbox | Excel Worksheet Functions | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
Simple hiding columns with vba does not work with a checkbox | Excel Programming |