Hi Folks,
I've just got my first macro working!!Admittedly with code I found an another forum.
Its this Sheet event code:
Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'Hide rows with formulas but no data'
Dim cell As Range
Application.ScreenUpdating = False
With ActiveSheet.UsedRange
.Rows.Hidden = False
For Each cell In .Columns(1).SpecialCells(xlCellTypeFormulas)
If cell.Text = "" Or cell.Value = 0 Then cell.EntireRow.Hidden = True
Next cell
End With
End Sub
This works fine for some of my worksheets as I am only interested in a single column. However on another worksheet I have 2 columns (A and H) with values returned by formulas but which are on their own row that I would like to hide if they return '0' value.
i.e.
A16 returns a value, then H17,18,19,20,21,22,23 also return values.
Then back to A25 with a returned value and then H26,27,28,29,30,31,32 with returned values
and so on and so on.
Can the above code be adapted to 'look' in both these columns?
Thanks very much in advance
Bookmarks