A
ArgarLargar
Hi,
I found some VBA code in this group which I have modified below. I
have not been able to get this to work in Excel 2003.
Option Explicit
Sub DelEmptyRow()
Dim ws As Worksheet, rw As Range, c1 As Range
Set ws = ActiveSheet
' Cycle through first 2000 rows
For Each rw In ws.Range("1:2000").Rows
' first cell in the row
Set c1 = rw.Cells(1)
' test if first cell is empty,
' and so do the rest of cells in the row
If c1.Formula = "" And c1.End(xlToRight).Column = 12 Then
rw.Delete
End If
Next rw
End Sub
I have more than 50,000 rows that need this.
Any suggestions?
Thanks,
Nick
I found some VBA code in this group which I have modified below. I
have not been able to get this to work in Excel 2003.
Option Explicit
Sub DelEmptyRow()
Dim ws As Worksheet, rw As Range, c1 As Range
Set ws = ActiveSheet
' Cycle through first 2000 rows
For Each rw In ws.Range("1:2000").Rows
' first cell in the row
Set c1 = rw.Cells(1)
' test if first cell is empty,
' and so do the rest of cells in the row
If c1.Formula = "" And c1.End(xlToRight).Column = 12 Then
rw.Delete
End If
Next rw
End Sub
I have more than 50,000 rows that need this.
Any suggestions?
Thanks,
Nick