Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default hide rows with specific contents

i need to hide rows if a cell's content is aa or bb or cc. these contents
are located in column A.
can i do it by a marco?

dennis


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default hide rows with specific contents

Use code like the following
Sub HideRows()
Dim r&
for r = 1 to Sheet1.UsedRange.Rows.Count
select case Sheet1.cells(r,1).value
Case "aa","bb","cc"
Sheet1.Rows(r).Hidden=true
Case Else
Sheet1.Rows(r).Hidden=false
end select
Next r
End Sub

"Dennis Cheung" wrote:

i need to hide rows if a cell's content is aa or bb or cc. these contents
are located in column A.
can i do it by a marco?

dennis



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default hide rows with specific contents

thanks, it helps.

"Alok" wrote in message
...
Use code like the following
Sub HideRows()
Dim r&
for r = 1 to Sheet1.UsedRange.Rows.Count
select case Sheet1.cells(r,1).value
Case "aa","bb","cc"
Sheet1.Rows(r).Hidden=true
Case Else
Sheet1.Rows(r).Hidden=false
end select
Next r
End Sub

"Dennis Cheung" wrote:

i need to hide rows if a cell's content is aa or bb or cc. these contents
are located in column A.
can i do it by a marco?

dennis





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
hide rows if nil result of formula in specific column Joy Excel Discussion (Misc queries) 2 March 1st 10 02:33 AM
Hide data in specific rows/colums/cells in Excel 2003 Ben Excel Discussion (Misc queries) 3 October 21st 07 04:33 PM
how to create a formula to hide specific rows after meeting requi DNelson New Users to Excel 2 February 7th 06 01:06 PM
Hide all rows where one specific cell in that row = 0? jaydevil Excel Discussion (Misc queries) 2 August 26th 05 02:48 PM
Code to hide rows based on cell contents Tim[_29_] Excel Programming 5 December 17th 03 02:59 PM


All times are GMT +1. The time now is 12:19 PM.

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

About Us

"It's about Microsoft Excel"