[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Deleting all lines on an Excel spreadsheet through VB

Posted on 2015-02-03
1
Medium Priority
?
76 Views
Last Modified: 2015-02-04
Experts,

Can someone help me with code to delete all the rows on an Excel spreadsheet except the header row in VB.
0
Comment
Question by:morinia
1 Comment
 
LVL 48

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 2000 total points
ID: 40587380
This will delete all but Row 1 of the active worksheet...

Range(Cells(2, 1), Cells(Rows.Count, 1)).EntireRow.Delete
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

591 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