Thanks Aaron;
After a few false starts I'm glad I could help you. A formula/helper column
solution is all I could "quickly" come up with at the time (although I new a
VBA solution would be better - not having to insert a cloumn and re-enter
the formula - should either get overwritten... I've been trying to break
into the Excel VBA programming and the Worksheet functions stuff now for 3
to 4 years and am just now beginning to understand the tip of the iceburg..
Looping has always baffled me - screwing my head into the ground, but once
you understand it, it is the key to performing 75%-90% of things (you need
doing).
Taking your last data info - just for practice I tried to create a VBA
solution, and it might work better for you. At present it is a bit crude at
it first goes from bottom to top (Column B) hiding all rows which do not
have the text "INV" in Column B (But it hids the Supplier Name -
BADDDDDD!!!) part 2 of the same macro returns and goes from bottom to top
(Column B) again and Unhides any previous row 1 above the first occasion of
the Text "INV".
Copy this into a Standard Module of your workbook:
Sub Foo()
Dim Lrow As Long
Dim i As Integer
Dim j As Integer
Application.ScreenUpdating = False
Lrow = Cells(Rows.Count, "B").End(xlUp).Row
For i = Lrow To 2 Step -1
If Cells(i, 2) <> "INV" Then
Cells(i, 2).EntireRow.Hidden = True
End If
Next i
For j = Lrow To 2 Step -1
If Cells(j, "b") = "INV" Then
Cells(j - 1, "b").EntireRow.Hidden = False
End If
Next j
Range("B2").Select
Application.ScreenUpdating = True
End Sub
Of course, after running the Macro - then Printing Your stuff,,, but when
you want to REVERSE the process that is Unhide
the previously hidden rows, a quick way is to while in the sheet click on
the SelectAll coordinate button (I call it) the blank
cell above the 1 (row) and to the left of the A (column) -- Doing so selects
every cell in the sheet - With it selected at the menu,
select Format, Rows, Unhide.
Besst of all No Formulas, No new Columns (hidden or otherwise)...
Your back in business;;
Just run Foo, anytime you want to view just rows with INV's...
Glad to help;
in appreciation just give me your feedback..
Tks,
Jim May
Virginia, USA
Once we