I'm having some problems getting this code to work. The code is located in a sheet called "Setup" but I want it to run on a sheet called "New"
Dim rng As Range
Range("D9:D44").EntireRow.Hidden = False
For Each ce In Range("D9:D44")
If IsEmpty(ce) Then
If rng Is Nothing Then
Set rng = ce
Else
Set rng = Union(rng, ce)
End If
End If
Next ce
rng.EntireRow.Hidden = True
I have tried modifying the code to the following
Dim rng As Range
Worksheet("New").Range("D9:D44").EntireRow.Hidden = False
For Each ce In Worksheet("New").Range("D9:D44")
If IsEmpty(ce) Then
If rng Is Nothing Then
Set rng = ce
Else
Set rng = Union(rng, ce)
End If
End If
Next ce
rng.EntireRow.Hidden = True
When I do this it doesn't like the last row of code. Anybody have any ideas.
Bookmarks