Delete row in a range

Closed
Aldo - Aug 17, 2008 at 04:05 AM
aquarelle Posts 7141 Registration date Saturday April 7, 2007 Status Moderator Last seen December 19, 2024 - Aug 17, 2008 at 10:17 AM
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 responses

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

couldnt you select the fields and just press on delete on your keyboard?
aquarelle Posts 7141 Registration date Saturday April 7, 2007 Status Moderator Last seen December 19, 2024 491
Aug 17, 2008 at 10:17 AM
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