Setting row height to 0 in the visible celss of a range

L

Luc

Hello there,


-I have a range of cells named "All"
-This range consists of a part of a column (for example A30-A1000)
-Depending on some paramaters not all of the rows of the range "All" are
visible (example : A40 to A55, A120 to A141 ,,, A750 to A766 are visible).
-I want to change the row height of the visible cells in the range "All"
which are empty to 0 row height (in fact hidden).
-Can someone provide me some code to do this


Thanks,

Luc
 
D

Dave Peterson

Are the empty cells really empty?

If yes:

Option Explicit
Sub testme02()
Dim myRng As Range
Set myRng = Worksheets("sheet1").Range("all")

On Error Resume Next
myRng.Cells.SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True
 

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