Solved

Count to last row and delete

Posted on 2012-04-13
2
192 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now