Clear range of cells in one or more excel worksheets

PeterBaileyUk
PeterBaileyUk used Ask the Experts™
on
I have two worksheets called:
CW data
Raw SMMT Data

I would like to clear the columns A to N

I know the number of columns that stays fixed how do I clear downwards to the last populated row?

would prefer not to have to go to 65536 as thats wasting processing time.

regards in advance
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2011
Commented:
I really don't believe you will notice any difference in speed clearing the entire column using:
Sheets("CW data").Range("A:N").Clearcontents

Open in new window

but if you wish you can use
with Sheets("CW data")
   Intersect(.Usedrange, .Range("A:N")).Clearcontents
End With

Open in new window

and similarly for the other sheet

Author

Commented:
perfect thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial