Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Conditional Hide rows with zero

Hi,

I would like a VBA code that will allow me to hide certain rows. That is,
if cell A3 has a "1" in it, then I want that entire row (only on this
worksheet, not throughout the workbook) to be hidden. I would also like it
to hide all of the totally blank rows at the bottom of the worksheet. The
last request is that this is a constantly running and as each cell in column
A changes to a "1" then the row is hidden.

Thanks,

Jon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Conditional Hide rows with zero

Jon

Worksheet event code........

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value = 1 Then
Excel.Range("A" & n).EntireRow.Hidden = True
End If
End If
enditall:
Application.EnableEvents = True
End Sub

Gord Dibben Excel MVP

On Wed, 10 Nov 2004 17:09:02 -0800, Vlookup help
wrote:

Hi,

I would like a VBA code that will allow me to hide certain rows. That is,
if cell A3 has a "1" in it, then I want that entire row (only on this
worksheet, not throughout the workbook) to be hidden. I would also like it
to hide all of the totally blank rows at the bottom of the worksheet. The
last request is that this is a constantly running and as each cell in column
A changes to a "1" then the row is hidden.

Thanks,

Jon


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Conditional Hide rows with zero

This is what I use:

For I = 1 To 800
Range("A" & I).Select
If ActiveCell.Value = "0" Then
Selection.EntireRow.Hidden = True
Else
End If

Next I




"Vlookup help" wrote:

Hi,

I would like a VBA code that will allow me to hide certain rows. That is,
if cell A3 has a "1" in it, then I want that entire row (only on this
worksheet, not throughout the workbook) to be hidden. I would also like it
to hide all of the totally blank rows at the bottom of the worksheet. The
last request is that this is a constantly running and as each cell in column
A changes to a "1" then the row is hidden.

Thanks,

Jon

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
CONDITIONAL HIDE/UNHIDE ROWS [email protected] Excel Discussion (Misc queries) 3 May 15th 07 12:20 PM
Hide rows with conditional formatting Gerry Verschuuren Excel Discussion (Misc queries) 5 April 8th 07 01:34 PM
Using VBA to Conditional Hide Rows? PBJ Excel Discussion (Misc queries) 1 February 16th 07 06:54 PM
Conditional Hide/Unhide Rows Gwen H Excel Discussion (Misc queries) 4 March 30th 05 06:52 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 12:08 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"