Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
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
Writing Macros GRoger Excel Discussion (Misc queries) 2 October 25th 07 10:43 PM
Easy way to Hide & Show Rows and update associated macros Eggtavius Excel Discussion (Misc queries) 0 March 28th 07 03:05 AM
Easy way to Hide & Show Rows and update associated macros Farhad Excel Discussion (Misc queries) 0 March 28th 07 01:21 AM
Writing Macros sportsbarn Excel Worksheet Functions 2 April 7th 06 10:40 AM
Conditional hide rows macros Stu[_4_] Excel Programming 1 September 25th 03 10:05 PM


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

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

About Us

"It's about Microsoft Excel"