Delete row in a range

Closed
Aldo - 17 Aug 2008 à 04:05
aquarelle Posts 7181 Registration date Saturday 7 April 2007 Status Moderator Last seen 14 February 2026 - 17 Aug 2008 à 10:17
Hello,
I copy a range from sheet1, workbook1 to workbook2, sheet2, after the last row, that means the range from workbook2, sheet2, is each time in another place. I want to delete empty rows from the range that reside in workbook2, sheet2. How should I do that?

Thanx very much
Related:

2 responses

jamesyap34 Posts 8 Registration date Thursday 1 May 2008 Status Member Last seen 15 October 2008
17 Aug 2008 à 09:58
hello,

couldnt you select the fields and just press on delete on your keyboard?
aquarelle Posts 7181 Registration date Saturday 7 April 2007 Status Moderator Last seen 14 February 2026 491
17 Aug 2008 à 10:17
Hello,
Maybe, you can adapt this macro :
'To delete empty rows in active worksheet

Sub DeleteEmptyRow()
LastRow = ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For x = LastRow To 1 Step -1
      If Application.CountA(Rows(x)) = 0 Then Rows(x).Delete
Next x
End Sub


Best regards