Solved

Count to last row and delete

Posted on 2012-04-13
2
204 Views
Last Modified: 2012-04-13
Hi,

On entering a WB i am counting the number of rows in ColA

 lngRow = Cells(Rows.Count, "A").End(xlUp).Row

I now want to clear contents from "A2:M2" down to the last row.

What line of code would i use for this?

Thanks
Seamus
0
Comment
Question by:Seamus2626
2 Comments
 
LVL 10

Accepted Solution

by:
gavsmith earned 500 total points
ID: 37841718
Range("A2:M" & lngRow).ClearContents
0
 

Author Closing Comment

by:Seamus2626
ID: 37841778
Excellent,

Thanks
Gav
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question