khawarameer
Board Regular
- Joined
- Jun 2, 2009
- Messages
- 152
Dear All,
I have a large worksheet with approx 55600 rows. However many rows in the sheet are empty. I used a macro to delete empty rows but it is giving me "Run time error '6' ". Here is the code i am using
Sub Deleterow()
Dim xlastrow As Integer
Dim xrow As Integer
xrow = 1
Range("a65000").End(xlUp).Select
xlastrow = ActiveCell.Row
Do Until xrow = xlastrow
If Cells(xrow, 1).Value = "" Then
Cells(xrow, 1).Select
Selection.EntireRow.Delete
xrow = xrow - 1
xlastrow = xlastrow - 1
End If
xrow = xrow + 1
Loop
End Sub
Can any one help me with this.
Regards
Khawar Ameer Malik
I have a large worksheet with approx 55600 rows. However many rows in the sheet are empty. I used a macro to delete empty rows but it is giving me "Run time error '6' ". Here is the code i am using
Sub Deleterow()
Dim xlastrow As Integer
Dim xrow As Integer
xrow = 1
Range("a65000").End(xlUp).Select
xlastrow = ActiveCell.Row
Do Until xrow = xlastrow
If Cells(xrow, 1).Value = "" Then
Cells(xrow, 1).Select
Selection.EntireRow.Delete
xrow = xrow - 1
xlastrow = xlastrow - 1
End If
xrow = xrow + 1
Loop
End Sub
Can any one help me with this.
Regards
Khawar Ameer Malik