Thread: Hide Rows
View Single Post
 
Old 10-17-2012, 07:33 AM
YounesB3 YounesB3 is offline Windows XP Office 2010 32bit
Advanced Beginner
 
Join Date: Jul 2012
Posts: 37
YounesB3 is on a distinguished road
Default Hide Rows

Hello everyone, I had a superb macro working before:

Code:
Sub HideRows()
Intersect(Range("Range1").SpecialCells(xlCellTypeBlanks).EntireRow, _
Range("Range2").SpecialCells(xlCellTypeBlanks).EntireRow) _
.EntireRow.Hidden = True
Intersect(Range("Range3").SpecialCells(xlCellTypeBlanks).EntireRow, _
Range("Range4").SpecialCells(xlCellTypeBlanks).EntireRow) _
.EntireRow.Hidden = True
Intersect(Range("Range5").SpecialCells(xlCellTypeBlanks).EntireRow, _
Range("Range6").SpecialCells(xlCellTypeBlanks).EntireRow) _
.EntireRow.Hidden = True
Intersect(Range("Range7").SpecialCells(xlCellTypeBlanks).EntireRow, _
Range("Range8").SpecialCells(xlCellTypeBlanks).EntireRow) _
.EntireRow.Hidden = True
Intersect(Range("Range9").SpecialCells(xlCellTypeBlanks).EntireRow, _
Range("Range10").SpecialCells(xlCellTypeBlanks).EntireRow) _
.EntireRow.Hidden = True
End Sub
This would hide rows of 5 different tab in a worksheet between 2 columns. The problem is, I now had to put some formulas to automate the file and the macro doesn't work anymore even if the value in the cell = "". Is it possible to change the above code to work for cells which are either blank or = ""?

Thanks a lot!

Note: Cross-posted in mrexcel (posted yesterday), but no answer so far.
Reply With Quote