This question already has an answer here:
hey everyone I'd like to make a macro that hides every row where in the Column E there's a 0 so that i'd have only rows with data in it.
Sub Hide_Columns_Containing_Value()
'Description: This macro will loop through a row and
'hide the column if the cell in row 1 of the column
'has the value of X.
'Author: Jon Acampora, Excel Campus
'Source:
Dim c As Range
For Each c In Range("E5:E15").Cells
If c.Value = "0" Then
c.EntireRow.Hidden = True
'You can change the property above to False
'to unhide the columns.
End If
Next c
End Sub
This is what I've found yet but i'd like it to go through the whole column until blank and not only a range as the size of the range will change everytime Thank you for your time and answers !
You could use Union to gather the qualifying rows and hide in one go.
Your question is not "How to hide rows that have 0", your code for that works already.
Your question title should be How to find ActiveRange
Asking the proper questions helps you find better solutions, quicker.