SolvedPrivate

VBA: Best way to clear contents for multiple columns starting with 2nd row, and all the way down

Posted on 2015-02-23
3
17 Views
Last Modified: 2016-02-10
What's the most efficient way to write the code to clear contents for multiple columns, let's say A through D, starting with 2nd row, and all the way down? Thanks
0
Comment
Question by:Dmitriy Kritskiy
3 Comments
 
LVL 15

Expert Comment

by:gplana
ID: 40626568
I think best way is:

Sheets("Test").Rows("2:65535").Delete
0
 
LVL 10

Accepted Solution

by:
Anthony Berenguel earned 500 total points
ID: 40626574
Try
    Application.Goto Reference:="R2C1:R2C4" 'where R is row and C is column. 
    Range(Selection, Selection.End(xlDown)).Select
    Selection.ClearContents

Open in new window

0
 

Author Closing Comment

by:Dmitriy Kritskiy
ID: 40626598
Perfect!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
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…

911 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

16 Experts available now in Live!

Get 1:1 Help Now