ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA - Clearing Shapes and Cell Contents (https://www.excelbanter.com/excel-programming/294706-excel-vba-clearing-shapes-cell-contents.html)

Rick[_19_]

Excel VBA - Clearing Shapes and Cell Contents
 
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



Tom Ogilvy

Excel VBA - Clearing Shapes and Cell Contents
 
Activesheet.Range("B:IV").ClearContents
for each shp in ActiveSheet.Shapes
shp.delete
Next

--
Regards,
Tom Ogilvy



"Rick" wrote in message
...
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





Rick[_19_]

Excel VBA - Clearing Shapes and Cell Contents
 
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


All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com