ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide Cells (https://www.excelbanter.com/excel-programming/318990-hide-cells.html)

lawson

Hide Cells
 
i want a program to search through column A and when it hits the first value
of 9999, if will turn the RowHeight to 0 (starting at the next row) until it
reaches the the next value of 9999

help please

Ron de Bruin

Hide Cells
 
Hi lawson

Sub Example()
Dim Firstrow As Long
Dim Lastrow As Long
Dim Lrow As Long
Dim CalcMode As Long

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

Firstrow = ActiveSheet.UsedRange.Cells(1).Row
Lastrow = ActiveSheet.UsedRange.Rows.Count + Firstrow - 1
With ActiveSheet
.DisplayPageBreaks = False
For Lrow = Lastrow To Firstrow Step -1
If IsError(.Cells(Lrow, "A").Value) Then
'Do nothing, This avoid a error if there is a error in the cell

ElseIf .Cells(Lrow, "A").Value = "999" Then .Rows(Lrow).Hidden = True

End If
Next
End With
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub

My Add-in have this option
Maybe you like it
http://www.rondebruin.nl/easyfilter.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"lawson" wrote in message ...
i want a program to search through column A and when it hits the first value
of 9999, if will turn the RowHeight to 0 (starting at the next row) until it
reaches the the next value of 9999

help please





All times are GMT +1. The time now is 05:06 PM.

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