MrExcel Publishing
Your One Stop for Excel Tips & Solutions

VBA: hide row if cell in row is blank


Posted by Squirrel on February 14, 2002 2:04 PM

My workbook (template) uses one sheet to enter daily production, have 6 other sheets (machines) that list production for the day using vlookup, then I hide product rows not being run that day on all 6 sheets for print.How would you write a vba macro that will look at col g(scheduled units) of each of the 6 sheets and hide the rows that do not have a scheduled qty.
GOT MILK?


Posted by Ed Acosta on February 14, 2002 3:01 PM

This MACRO will do what you want. To run it hit CTRL+SHIFT+G.

Sub HideclmG()
'
' HideclmG Macro
' Macro recorded 2/14/2002 by Ed
'
' Keyboard Shortcut: Ctrl+Shift+G
'
Columns("G:G").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Hidden = True
Range("A2").Select
End Sub

Posted by Squirrel on February 16, 2002 4:33 AM

Re: How would i keep it from hidden rows in other sheets

Thanks Ed, I have other sheets in the workbook, will these be done on a page by page, or will it run threw the entire workbook? HideclmG Macro Macro recorded 2/14/2002 by Ed Keyboard Shortcut: Ctrl+Shift+G