ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide Rows If Cell Value = False (https://www.excelbanter.com/excel-programming/298557-hide-rows-if-cell-value-%3D-false.html)

TOMB[_2_]

Hide Rows If Cell Value = False
 
Windows 2000; Excel 2000

I am using several checkbox controls (format control and
cell link) to toggle a cell's value between 'True'
and 'False'.

I would like to hide or unhide rows based on these cells.

Any suggestions besides using AutoFilter?

Thanks in advance.



Frank Kabel

Hide Rows If Cell Value = False
 
Hi
try something like the following:
Sub hide_rows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Value = False Then
Rows(RowNdx).hidden = True
End If
Next RowNdx
End Sub

hides all 'False' rows in column A


--
Regards
Frank Kabel
Frankfurt, Germany


TOMB wrote:
Windows 2000; Excel 2000

I am using several checkbox controls (format control and
cell link) to toggle a cell's value between 'True'
and 'False'.

I would like to hide or unhide rows based on these cells.

Any suggestions besides using AutoFilter?

Thanks in advance.


Tom Ogilvy

Hide Rows If Cell Value = False
 
use the click event of the checkbox.

--
Regards,
Tom Ogilvy

"TOMB" wrote in message
...
Windows 2000; Excel 2000

I am using several checkbox controls (format control and
cell link) to toggle a cell's value between 'True'
and 'False'.

I would like to hide or unhide rows based on these cells.

Any suggestions besides using AutoFilter?

Thanks in advance.





TOMB[_2_]

Hide Rows If Cell Value = False
 
Frank, thanks for the help. You got me 90% there! I just
had to add a few lines and change the column reference.
You made it easy for me!

- - TB - -

-----Original Message-----
Hi
try something like the following:
Sub hide_rows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Value = False Then
Rows(RowNdx).hidden = True
End If
Next RowNdx
End Sub

hides all 'False' rows in column A


--
Regards
Frank Kabel
Frankfurt, Germany


TOMB wrote:
Windows 2000; Excel 2000

I am using several checkbox controls (format control and
cell link) to toggle a cell's value between 'True'
and 'False'.

I would like to hide or unhide rows based on these

cells.

Any suggestions besides using AutoFilter?

Thanks in advance.

.



All times are GMT +1. The time now is 10:33 AM.

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