alienscript
11-09-2008, 12:58 AM
Hello VB expert,
I am trying to have the entire rows to be deleted if the specified cells are all empty. I tried with Union but not sure how the next syntax should be. Excel is XP office 2003 and I have rows in "group and outline" enabled. Thanks in advance.
Dim i As Long, lastrow As Long, MyRng as Range
lastrow = Cells(65536, 1).End(xlUp).Row
For i = 6 To lastrow
Set MyRng = Application.Union(Cells(i, 2), Cells(i, 3), Cells(i, 4), Cells(i, 6), Cells(i, 7), Cells(i, 8), Cells(i, 10), _
Cells(i, 11), Cells(i, 12), Cells(i, 14), Cells(i, 15), Cells(i, 16), Cells(i, 18), Cells(i, 19), Cells(i, 20))
I am trying to have the entire rows to be deleted if the specified cells are all empty. I tried with Union but not sure how the next syntax should be. Excel is XP office 2003 and I have rows in "group and outline" enabled. Thanks in advance.
Dim i As Long, lastrow As Long, MyRng as Range
lastrow = Cells(65536, 1).End(xlUp).Row
For i = 6 To lastrow
Set MyRng = Application.Union(Cells(i, 2), Cells(i, 3), Cells(i, 4), Cells(i, 6), Cells(i, 7), Cells(i, 8), Cells(i, 10), _
Cells(i, 11), Cells(i, 12), Cells(i, 14), Cells(i, 15), Cells(i, 16), Cells(i, 18), Cells(i, 19), Cells(i, 20))