Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default macro to hide data (with conditional formatting?)

I have a large spreadsheet and I want it to automatically HIDE a row if a
certain cell value meets a specific criteria. Does anyone know if this can be
done? I know I can do this manually but would like to automate if possible.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default macro to hide data (with conditional formatting?)

I believe this is what you are after. Right click the sheet tab where
you want this to take place and paste this (modify to suite):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Text = "Freddy" Then _
Target.EntireRow.Hidden = True
End Sub

This will hide the target's row anytime Freddy is entered into it.
Ginna Moore wrote:
I have a large spreadsheet and I want it to automatically HIDE a row if a
certain cell value meets a specific criteria. Does anyone know if this can be
done? I know I can do this manually but would like to automate if possible.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default macro to hide data (with conditional formatting?)

Or you can use something like this in the Workbook_Open event to hide
all rows in Sheet 1 where the value in column A is Freddy.
Private Sub Workbook_Open()
Dim r As Long
With Sheets("Sheet1")
.Rows.Hidden = False
For r = 2 To .Cells(.Rows.Count, 1).End(xlUp).Row
If .Cells(r, 1).Value = "Freddy" Then _
.Cells(r, 1).EntireRow.Hidden = True
'or .Rows(r).Hidden = True
Next r
End With
End Sub

Ginna Moore wrote:
I have a large spreadsheet and I want it to automatically HIDE a row if a
certain cell value meets a specific criteria. Does anyone know if this can be
done? I know I can do this manually but would like to automate if possible.

Thanks.


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
How can I use conditional formatting to hide or delete rows? linda.beautiful.california Excel Worksheet Functions 6 July 15th 08 09:09 PM
macro to hide data (with conditional formatting?) Ginna Moore Excel Worksheet Functions 1 October 18th 07 08:42 PM
Hide rows with conditional formatting Gerry Verschuuren Excel Discussion (Misc queries) 5 April 8th 07 01:34 PM
Conditional Formatting to Hide Rows or Columns? sczegus Excel Discussion (Misc queries) 3 September 27th 06 09:32 PM
CAN I HIDE ROWS WITH CONDITIONAL FORMATTING? Likepike Excel Discussion (Misc queries) 2 December 21st 04 04:02 PM


All times are GMT +1. The time now is 06:30 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"