#1   Report Post  
david
 
Posts: n/a
Default macro to hide rows


I need to hide rows depending on whats in the cells (a1,a2,a3,...)

can somewane give me a example of a macro for this.

thank you
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I find this an easier alternative:

Apply Data|filter|autofilter to your column (or whole range).

Then use the filter arrow to show/hide the rows you want.

If you've never used autofilter before, Debra Dalgleish has some info at:
http://www.contextures.com/xlautofilter01.html



david wrote:

I need to hide rows depending on whats in the cells (a1,a2,a3,...)

can somewane give me a example of a macro for this.

thank you


--

Dave Peterson
  #3   Report Post  
Pete McCosh
 
Posts: n/a
Default

David,

something like this: just subsitute the number of rows in the For loop and
the values you want to test.

Sub Hide_Unwanted_Rows()

Dim X as Integer

For X = 2 to 100

If cells(x,1).value =0 Then
Rows(x).hidden=true
End if

Next x

End Sub

Cheers, Pete.

"david" wrote:


I need to hide rows depending on whats in the cells (a1,a2,a3,...)

can somewane give me a example of a macro for this.

thank you

  #4   Report Post  
david
 
Posts: n/a
Default


thanks !!!!!!!!!!!



------------------------------------------------------

"Pete McCosh" wrote:

David,

something like this: just subsitute the number of rows in the For loop and
the values you want to test.

Sub Hide_Unwanted_Rows()

Dim X as Integer

For X = 2 to 100

If cells(x,1).value =0 Then
Rows(x).hidden=true
End if

Next x

End Sub

Cheers, Pete.

"david" wrote:


I need to hide rows depending on whats in the cells (a1,a2,a3,...)

can somewane give me a example of a macro for this.

thank you

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
inset rows and copy formatting , excel macro sloanranger Excel Discussion (Misc queries) 13 March 9th 05 11:44 PM
how to hide rows in a protected sheet Prakash Excel Worksheet Functions 7 January 18th 05 02:42 PM
Adding Rows to Master Sheet Excel Newbie New Users to Excel 1 December 23rd 04 10:56 PM
Macro to hide rows with empty cells tp58tp Excel Worksheet Functions 2 November 13th 04 02:01 PM
Macro for sorting different rows ciscopena Excel Worksheet Functions 0 November 1st 04 11:04 PM


All times are GMT +1. The time now is 01:25 AM.

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"