[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • Last Modified:

Clearing results from a spreadsheet in VB - Excel 2010

Experts,

I have a spreadsheet  in Excel that loads from a query and module that runs in VB.  How do I clear the results from a prior run?
0
morinia
Asked:
morinia
  • 7
  • 4
  • 3
2 Solutions
 
Randy PooleCommented:
SheetName.Cells.Clear
0
 
moriniaAdvanced Analytics AnalystAuthor Commented:
The first line has headings.  Is there a way to clear the rest of the lines and leave the first line.  Sorry, I forgot to mention that.
0
 
Martin LissRetired ProgrammerCommented:
SheetName.UsedRange.Cells.Offset(1, 0).ClearContents
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Randy PooleCommented:
There you go :)
0
 
Martin LissRetired ProgrammerCommented:
I think you should split the points between Randy and myself, with him getting the bulk of them because he answered your original question, and I've requested attention to help you do that.
0
 
Randy PooleCommented:
It is no problem, just glad to help :)
0
 
Martin LissRetired ProgrammerCommented:
@morinia: Note that there's a difference between Clear and ClearContents. ClearContents removes only the values from the cells, whereas Clear removes the values and the cell formatting.
0
 
moriniaAdvanced Analytics AnalystAuthor Commented:
You are correct. What steps do I need to split points.?  I don't see an  option to "Request Attention".
0
 
Martin LissRetired ProgrammerCommented:
The Request Attention link is normally in the lower right hand corner of the first post in a thread, but since I already did it for you it's no longer there. You can however click the link in the salmon-colored area at the top of the thread. A moderator will respond soon no matter if you do that or not.
0
 
Martin LissRetired ProgrammerCommented:
Here's a picture of the Request Attention link from another question.
RA
0
 
Martin LissRetired ProgrammerCommented:
A moderator has reopened this question so that you can reassign the points.
0
 
Martin LissRetired ProgrammerCommented:
I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
0
 
moriniaAdvanced Analytics AnalystAuthor Commented:
Thanks
0
 
Randy PooleCommented:
Thank you :)
0

Featured Post

Industry Leaders: 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!

  • 7
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now