Clear Contents of a Worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having problems clearing all of the contents from a worksheet. All of my VBA code is embedded in a worksheet that is triggered by a command button which I have placed on the sheet. The sheet contains a report that displays various rows of data returned from a database query. My code will loop until there are no more lines of data to display, at which time a total line is displayed. At the bottom of the last row of data returned (before the total is displayed), I insert a border under the row to set the data apart from the totals. My problem is that when I clear the contents of my worksheet to return the results of a new query, the old border still remains. This is the code that I use to insert my border

Worksheets("Main").Range("C" & mrowcount & ":T" & mrowcount).Borders(xlEdgeBottom).LineStyle = xlContinuou

This is the code that I use to clear my worksheet
Worksheets("Main").Range("A11:T65000").ClearContent

Any suggestions would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top