Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
writing macros to hide rows
Hello,
I am trying to find a way to hide rows after running a rule mechanism or macro. For examplet there are 5 columns and a 1000 rows in which; Specifically we would designate 2 out of the five rows in which the other 3 rows would not be relevant. For example cell A(1) and cell D(1) (in the same row) both equal zero then hide that row. We would want the search to run from the first to last row. I am not sure if this is possible but your input would be appreciated. Regards |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
writing macros to hide rows
Try this Steve for the usedrange
Sub Example1() 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 .Cells(Lrow, "A").Value = "0" And _ .Cells(Lrow, "D").Value = "0" Then .Rows(Lrow).Hidden = True Next End With With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Steve" wrote in message ... Hello, I am trying to find a way to hide rows after running a rule mechanism or macro. For examplet there are 5 columns and a 1000 rows in which; Specifically we would designate 2 out of the five rows in which the other 3 rows would not be relevant. For example cell A(1) and cell D(1) (in the same row) both equal zero then hide that row. We would want the search to run from the first to last row. I am not sure if this is possible but your input would be appreciated. Regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Writing Macros | Excel Discussion (Misc queries) | |||
Easy way to Hide & Show Rows and update associated macros | Excel Discussion (Misc queries) | |||
Easy way to Hide & Show Rows and update associated macros | Excel Discussion (Misc queries) | |||
Writing Macros | Excel Worksheet Functions | |||
Conditional hide rows macros | Excel Programming |