Automatically change properties of ALL pictures in an Excel file

dalbright

New Member
Joined
Sep 29, 2011
Messages
13
I have a user that has an excel 2007 file that was exported from a piece of scientific software. There are several columns of data and one of the columns includes a picture of the scientific compound. They may have several hundred compounds that are downloaded into the spreadsheet but they may only want to keep say 50 of them. They can filter the data based on specific criteria and delete the rows they do not want to keep. However, at the very end of the spreadsheet there is one row that has each of the several hundred pictures stacked ontop of each other. Unless you select each picture and change the property "Object Positioning" to "Move and size with cells" one by one then you have to delete the objects one by one. Is there a way to change this property, either as an Excel default or through a macro? Appreciate the help in advance!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Welcome to MrExcel.

Here's a short macro:

Code:
Sub Test()
    Dim Pic As Picture
    For Each Pic In ActiveSheet.Pictures
        Pic.Placement = xlMoveAndSize
    Next Pic
End Sub
 
Upvote 0
Try with a macro

Code:
Sub stest()
Dim oPic As Picture
For Each oPic In ActiveSheet.Pictures
    oPic.Placement = xlMoveAndSize
Next oPic
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,862
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top