Macro to hide rows with empty cells

T

tp58tp

I have a spreadsheet to reflect daily production. In columns A and B there
is a complete listing of all product codes and descriptions. Column C is the
particular day's production. When I normally prepare this for distribution I
manually hide the rows of products which had no production for that day - to
make a short, concise report. How can I create a macro to auomatically do
this?
 
D

Debra Dalgleish

Instead of a macro, you could use an AutoFilter (Data>Filter>AutoFilter)
In the dropdown in the heading for Column C, select (NonBlanks)
Or, if the rows contain zeros, choose Custom, and set the criteria to
not equal to 0

There's information on AutoFilter in Excel's Help, and here:

http://contextures.com/xladvfilter01.html
 
B

Bob Phillips

Turn the macro recorder on, select column C, Data>Filter, select the
dropdown at the head of the column, and choose NonBlanks, stop the macro
recorder.

That's it, you have your macro.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top