Restore a range of cells to "empty"?

R

Robert Crandal

One of my sheets is originally empty, but my user will sometimes
paste a group of data to fill the range of A1:H17. Or, they might
also run a macro which dumps data from an ADO Recordset
object that fills the range A1:H17.

How do I restore my range (A1:H17) back to its original empty
state after any of the above operations occur? (How do I do
this using VBA code for Excel 2007?)

Thank you!
 
D

Don Guillett Excel MVP

One of my sheets is originally empty, but my user will sometimes
paste a group of data to fill the range of A1:H17.   Or, they might
also run a macro which dumps data from an ADO Recordset
object that fills the range A1:H17.

How do I restore my range (A1:H17) back to its original empty
state after any of the above operations occur?  (How do I do
this using VBA code for Excel 2007?)

Thank you!

Manually: Select the range and touch the delete key
Macro:
sub clearcells()
range("a1:h17").clear
end sub
 

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

Top