J
Justin
This code is to hide the entire row if the cell in column D is empty.
This code returns the Type MisMatch error:
Sub hideme()
Application.ScreenUpdating = False
Dim myrange As Range, myrange1 As Range
lastrow = Cells(Rows.Count, "D").End(xlUp).Row
Set myrange = Range("D4" & lastrow)
For Each c In myrange
If c.Value = "" Then
If myrange1 Is Nothing Then
Set myrange1 = c.EntireRow
Else
Set myrange1 = Union(myrange1, c.EntireRow)
End If
End If
Next
myrange1.EntireRow.Hidden = True
End Sub
It also does work in my 2003 version but doesn't in the 2007... anyone know
why this is?
This code returns the Type MisMatch error:
Sub hideme()
Application.ScreenUpdating = False
Dim myrange As Range, myrange1 As Range
lastrow = Cells(Rows.Count, "D").End(xlUp).Row
Set myrange = Range("D4" & lastrow)
For Each c In myrange
If c.Value = "" Then
If myrange1 Is Nothing Then
Set myrange1 = c.EntireRow
Else
Set myrange1 = Union(myrange1, c.EntireRow)
End If
End If
Next
myrange1.EntireRow.Hidden = True
End Sub
It also does work in my 2003 version but doesn't in the 2007... anyone know
why this is?