Want to auto hide rows in excel when no data in a certain column.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a group of spreadsheets that use form 5 to 50 rows. I want to hide
the blank rows when I have less than the 50. However, there is formulas in
the row so I want to base the hiding on 1 column where I input the initial
data.
 
By selection the whole dataset (including headers) and selecting Data
Filter > Autofilter. Then click the small arrow on the colomn that ha
you want to base the hiding on and customize it
 
I like the autofilter, too. It's easy to use and easy to explain how to turn it
on/off.

But if you need a macro:

Option Explicit
Sub testme()

Dim myRng As Range
Dim myCell As Range

With Worksheets("Sheet1")
Set myRng = .Range("a5:A54")

For Each myCell In myRng.Cells
myCell.EntireRow.Hidden = CBool(myCell.Value = "")
Next myCell
End With
End Sub
 

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

Back
Top