Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default hiding rows with checkbox

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default hiding rows with checkbox

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default hiding rows with checkbox

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default hiding rows with checkbox

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default hiding rows with checkbox

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default hiding rows with checkbox

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default hiding rows with checkbox

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Color alternate rows when after hiding selected rows Monk[_2_] Excel Worksheet Functions 6 June 7th 08 01:36 AM
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
Hiding a ComboBox with a Checkbox AWeb Excel Worksheet Functions 2 September 15th 06 01:30 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Simple hiding columns with vba does not work with a checkbox Brian Excel Programming 3 January 9th 04 10:39 PM


All times are GMT +1. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"