Hide Rows Macro

Closed
akram786 Posts 7 Registration date Wednesday April 30, 2014 Status Member Last seen June 30, 2014 - Apr 30, 2014 at 06:48 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - May 6, 2014 at 11:07 AM
Dear Sir

i have some Record in Sheet1

Parts Name
Parts Used in Section
parts Used Quantity

if my parts used Quantity is 0 then Row will Hide
i want Macro for this Function Becuase i have lot of data and
i want print only Exits Value in Parts Used Quantity

1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
May 6, 2014 at 11:07 AM
Hi Akram786,

You didn't tell us what column you use for qty, I assumed column C:
Sub RunMe()
Dim lRow As Integer

lRow = Range("C" & Rows.Count).End(xlUp).Row

For Each cell In Range("C1:C" & lRow)
    If cell.Value = 0 Then cell.EntireRow.Hidden = True
Next cell
End Sub


And to show hidden rows again:
Sub Undo()
Cells.EntireRow.Hidden = False
End Sub


Best regards,
Trowa
0