Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Automatically hide column or row if a cell value meets criteria

I need a macro or formula that will automatically hide a row or column
based on an entry in a specific cell.

For instance, =IF(D2="",*****,D2)

with ***** being the formula

or =IF(C3=0,Rows("3:3").Select,Selection.EntireRow.Hi dden=True,C3)

of course this isn't working but something like this would be great

Thanks so much for your continued assistance.

Don
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Automatically hide column or row if a cell value meets criteria

Private Sub Worksheet_Calculate()
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("C3")
If .Value = 0 Then
.EntireRow.Hidden = True
Else
.EntireRow.Hidden = False
End If
End With
stoppit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP


On Wed, 4 Jun 2008 06:56:37 -0700 (PDT), wrote:

I need a macro or formula that will automatically hide a row or column
based on an entry in a specific cell.

For instance, =IF(D2="",*****,D2)

with ***** being the formula

or =IF(C3=0,Rows("3:3").Select,Selection.EntireRow.Hi dden=True,C3)

of course this isn't working but something like this would be great

Thanks so much for your continued assistance.

Don


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Automatically hide column or row if a cell value meets criteri

I am having a similiar problem. I wanted to hide a row everytime a task is
complete. For example, anytime in colum F shows status complete I want to
hide row.

1. What would be the best macro for this function?
2. How do I add a macro to excel?

Thanks in advance!

"Gord Dibben" wrote:

Private Sub Worksheet_Calculate()
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("C3")
If .Value = 0 Then
.EntireRow.Hidden = True
Else
.EntireRow.Hidden = False
End If
End With
stoppit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP


On Wed, 4 Jun 2008 06:56:37 -0700 (PDT), wrote:

I need a macro or formula that will automatically hide a row or column
based on an entry in a specific cell.

For instance, =IF(D2="",*****,D2)

with ***** being the formula

or =IF(C3=0,Rows("3:3").Select,Selection.EntireRow.Hi dden=True,C3)

of course this isn't working but something like this would be great

Thanks so much for your continued assistance.

Don



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Automatically hide column or row if a cell value meets criteri

How would the "status complete" get entered into column F?

If manually just use this code

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 6 And _
Target.Value = "complete" Then
Target.EntireRow.Hidden = True
End If
enditall:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste into that sheet module.

Edit to suit then Alt + q to return to the Excel sheet.

Enter "complete"(no quotes) in F1 and see row1 disappear(hide).


Gord

On Tue, 10 Jun 2008 12:10:00 -0700, Mindy
wrote:

I am having a similiar problem. I wanted to hide a row everytime a task is
complete. For example, anytime in colum F shows status complete I want to
hide row.

1. What would be the best macro for this function?
2. How do I add a macro to excel?

Thanks in advance!

"Gord Dibben" wrote:

Private Sub Worksheet_Calculate()
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("C3")
If .Value = 0 Then
.EntireRow.Hidden = True
Else
.EntireRow.Hidden = False
End If
End With
stoppit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP


On Wed, 4 Jun 2008 06:56:37 -0700 (PDT), wrote:

I need a macro or formula that will automatically hide a row or column
based on an entry in a specific cell.

For instance, =IF(D2="",*****,D2)

with ***** being the formula

or =IF(C3=0,Rows("3:3").Select,Selection.EntireRow.Hi dden=True,C3)

of course this isn't working but something like this would be great

Thanks so much for your continued assistance.

Don




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
Getting a Value IF a cell meets a criteria ThunderStorm Studio[_2_] Excel Discussion (Misc queries) 1 February 18th 08 07:29 PM
How do I count in column A when it meets all criteria in three col dereksmom Excel Worksheet Functions 2 November 9th 06 04:37 PM
How can I get a cell to Flash if it meets a certain criteria in Ex tcfoote Excel Worksheet Functions 1 October 31st 06 04:03 PM
How do I go to the next cell that meets criteria Neil Excel Discussion (Misc queries) 3 May 12th 06 04:34 PM
Highlight a row automatically if a cell meets certain criteria simonvrowley Excel Worksheet Functions 5 March 16th 06 11:16 AM


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