Delete row in a range

[Closed]
Report
-
Posts
7098
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
June 10, 2021
-
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

2 replies

Posts
8
Registration date
Thursday May 1, 2008
Status
Member
Last seen
October 15, 2008

hello,

couldnt you select the fields and just press on delete on your keyboard?
Posts
7098
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
June 10, 2021
487
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