PDA

View Full Version : Solved: Deleting Rows



Anomandaris
11-16-2009, 03:06 AM
2 questions:

1) How to delete all Used rows except Row 1.
2) For Columns A to V, delete all used rows except row 1
For Columns W to Z delete all used rows except rows 1 & 2

Please advise

thanks

Bob Phillips
11-16-2009, 03:43 AM
Untested

1)


With ActiveSheet

.UsedRange.Rows(2).Resize(.UsedRange.Rows.Count -1).Delete
End With


2)


With ActiveSheet

.UsedRange.Cells(2, 1).Resize(.UsedRange.Rows.Count -1, 22).ClearContents
End With


erc.

Anomandaris
11-16-2009, 03:56 AM
Yup, you're right as usual!
Thanks a lot Xld!