Excel VBA - Clearing Shapes and Cell Contents

G

Guest

Hello;

I have an Excel spreadsheet which I use to import images and create sort of a product catalog. It's working great.

However, I'm unable to come up with code that works for clearing/resetting the page. I've tried 3 or 4 different ways without any success.

What I need to do is clear all cell contents and shapes (images) within every column but "A". Anybody have a code sample that would do this??

Thanks in advance for your help. I appreciate it!

Rick
 
T

Tom Ogilvy

Activesheet.Range("B:IV").ClearContents
for each shp in ActiveSheet.Shapes
shp.delete
Next

--
Regards,
Tom Ogilvy



Rick said:
Hello;

I have an Excel spreadsheet which I use to import images and create sort
of a product catalog. It's working great.
However, I'm unable to come up with code that works for clearing/resetting
the page. I've tried 3 or 4 different ways without any success.
What I need to do is clear all cell contents and shapes (images) within
every column but "A". Anybody have a code sample that would do this??
 
G

Guest

Thanks Tom. It looks like that would delete all shapes on the sheet. I have two command buttons and a graphic in column A that I would like to retain while deleting the shapes on the rest of the sheet. Any ideas? Thanks in advance

Rick
 

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