Hide Rows Macro [Closed]

Report
Posts
7
Registration date
Wednesday April 30, 2014
Status
Member
Last seen
June 30, 2014
-
Posts
2676
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 3, 2020
-
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 reply

Posts
2676
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 3, 2020
448
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

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!