Excel VBA: Replace Images (Shapes) Locked To Cells With Text

This is some code that will replace an image/shape that is locked to a cell with text.

Note: These bits of code are mostly for my own reference, but if anyone else finds them useful all the better.

I recently grabbed some data from a table on a web page that I wanted to use in Excel. When pasted into Excel, some of the information came across as little images instead of text in a cell. Since I wanted to be able to sort the data I had to figure out how to convert the images into some text that was in the cell.

Doing some investigating , I found that I could get identifying information about the images from the AltText information.

Here is a chunk of code to loop through the images and spit the information into a list to make sure it can be used.

Once I was happy I could automate the conversion, I did. Here is the code that did that.

The worksheet now looked like this.

Now I could remove the images.

The end result.

One comment on “Excel VBA: Replace Images (Shapes) Locked To Cells With Text”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.