Question:
Auto hide rows in Excel 2007?
V_vesanie
2009-02-27 23:53:47 UTC
I have list of services table in Excel, when a certain row has 0 value I want it to automatically hide itself for printing.

Is there a Macro code to do this?
Three answers:
Kermit The Rock
2009-02-28 00:13:42 UTC
There isn't anything in excel to do this, but you can define complex print areas. the following macro will select every row where the 5th column has a 1 (rows between 2nd and 1000 anyway)



once selected, use the print area set feature. Excel can also hide rows (or columns) from view and print (actually it sets the row height=0). use whichever meets your needs best.



Sub selectrows()

Dim str

For i = 2 To 1000

If ActiveWorkbook.Worksheets("sheet1").Cells(i, 5) = 1 Then

str = str & i & ":" & i & ","

End If



Next i

str = Left(str, Len(str) - 1)

Stop

'Range("7:7,10:10,12:12,13:13,15:15,19:19,20:20,22:22").Select

ActiveWorkbook.Worksheets("sheet1").Range(str).Select



End Sub
Photoshop
2009-03-03 11:05:42 UTC
reate a custom view with everything visible call it ALL



Use Autofilter to hide the rows with 0



Then choose View Custom View and create new view called hidden rows.



To make it easier to move between the views. Choose View, and Customize add the custom views button to the standard toolbar.



Now you can show or hide with a combo box with no need for code
tusa
2016-10-26 09:22:33 UTC
This demands VBA programming, yet you are able to sparkling out a row making use of conditional formatting. First elect the full row with the aid of clicking the row variety on the left. Then pass to format -> Conditional formatting (Excel 2003). 1st difficulty: formulation is ... =A$a million="cover" click the format button and decide white font. ok. this might sparkling out the tips if the text fabric in A1 is "cover".


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...