Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default CONDITIONAL HIDE/UNHIDE ROWS

I have code to hide rows (which works) and I also have code to unhide
rows. I'm simply having trouble combining the code into one macro.
If anybody can help I will greatly appreciate it. Below is a copy of
the code. Thanks.

Sub hide_rows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "V").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Cells(RowNdx, "V").Value = 0 Then
Rows(RowNdx).Hidden = True

End If
Next RowNdx
End Sub

________________________________
Sub Unhide()

Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "V").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Cells(RowNdx, "V").Value 0 Then
Rows(RowNdx).Hidden = False
End If
Next RowNdx

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default CONDITIONAL HIDE/UNHIDE ROWS

On May 14, 9:30 am, "papou" wrote:
Hi

Sub hide_unhide_rows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
Select Case Cells(RowNdx, "A").Value
Case Is = 0
Rows(RowNdx).Hidden = True
Case Is 0
Rows(RowNdx).Hidden = False
End Select
Next RowNdx
End Sub

HTH
Cordially
Pascal

a écrit dans le message de news:
. com...



I have code to hide rows (which works) and I also have code to unhide
rows. I'm simply having trouble combining the code into one macro.
If anybody can help I will greatly appreciate it. Below is a copy of
the code. Thanks.


Sub hide_rows()
Dim RowNdx As Long
Dim LastRow As Long


LastRow = ActiveSheet.Cells(Rows.Count, "V").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Cells(RowNdx, "V").Value = 0 Then
Rows(RowNdx).Hidden = True


End If
Next RowNdx
End Sub


________________________________
Sub Unhide()


Dim RowNdx As Long
Dim LastRow As Long


LastRow = ActiveSheet.Cells(Rows.Count, "V").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Cells(RowNdx, "V").Value 0 Then
Rows(RowNdx).Hidden = False
End If
Next RowNdx


End Sub- Hide quoted text -


- Show quoted text -


It worked perfectly! Thanks. I'm trying to teach myself this and
realize my life will be much easier once I become procificient in it.
Thanks again, oh, I simply had to change you code a bit, you had the
"A" column when I was looking for the "V" column, but you probably did
that on purpose.

James

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 110
Default CONDITIONAL HIDE/UNHIDE ROWS

Hello James
Thanks for your feedback, glad it helped -;)

Cordially
Pascal
a écrit dans le message de news:
...
On May 14, 9:30 am, "papou" wrote:
Hi

Sub hide_unhide_rows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
Select Case Cells(RowNdx, "A").Value
Case Is = 0
Rows(RowNdx).Hidden = True
Case Is 0
Rows(RowNdx).Hidden = False
End Select
Next RowNdx
End Sub

HTH
Cordially
Pascal

a écrit dans le message de news:
. com...



I have code to hide rows (which works) and I also have code to unhide
rows. I'm simply having trouble combining the code into one macro.
If anybody can help I will greatly appreciate it. Below is a copy of
the code. Thanks.


Sub hide_rows()
Dim RowNdx As Long
Dim LastRow As Long


LastRow = ActiveSheet.Cells(Rows.Count, "V").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Cells(RowNdx, "V").Value = 0 Then
Rows(RowNdx).Hidden = True


End If
Next RowNdx
End Sub


________________________________
Sub Unhide()


Dim RowNdx As Long
Dim LastRow As Long


LastRow = ActiveSheet.Cells(Rows.Count, "V").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Cells(RowNdx, "V").Value 0 Then
Rows(RowNdx).Hidden = False
End If
Next RowNdx


End Sub- Hide quoted text -


- Show quoted text -


It worked perfectly! Thanks. I'm trying to teach myself this and
realize my life will be much easier once I become procificient in it.
Thanks again, oh, I simply had to change you code a bit, you had the
"A" column when I was looking for the "V" column, but you probably did
that on purpose.

James


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 / Unhide columns and rows PaulM Excel Discussion (Misc queries) 8 September 6th 07 12:14 AM
How to hide and unhide Rows & Columns Aarif Excel Worksheet Functions 3 March 23rd 06 05:19 AM
Hide Unhide Rows blackstar Excel Discussion (Misc queries) 2 February 6th 06 09:36 PM
Conditional Hide/Unhide Rows Gwen H Excel Discussion (Misc queries) 4 March 30th 05 06:52 AM
Checkbox to hide and unhide rows Please. Steved Excel Worksheet Functions 2 December 6th 04 11:30 PM


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