Google Sheets IMAGE Function

excelbytes

Board Regular
Joined
Dec 11, 2014
Messages
144
Office Version
  1. 365
Platform
  1. Windows
Is there any way to replicate the IMAGE function from Google Sheets in Excel? Maybe a VBA code? From what I can tell, the function in Google Sheets takes a URL and imbeds that image into a cell, not a hovered object like Excel would. The syntax is =IMAGE(url, [mode], [height], [width]). An example pulling in Google's logo is =IMAGE("https://www.google.com/images/srpr/logo3w.png").
 

Dan_W

Well-known Member
Joined
Jul 11, 2018
Messages
789
Office Version
  1. 365
Platform
  1. Windows
You only need to do it once, though, right? If so, the subroutine proposal I made is likely the best option. Mind you, a spreadsheet with 1500 images in it was never really going to be nimble...

(Glad it's working for you now - am slightly concerned re: the upper case / lower case point, but let's not poke the VBA bear today)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Dan_W

Well-known Member
Joined
Jul 11, 2018
Messages
789
Office Version
  1. 365
Platform
  1. Windows
Hi - so I was thinking about your project, and the I'm thinking that:

First, using a worksheet function is not the best/quickest approach if, as it seems, you really only need to do it the one time. All you really need to do is download the images, and have them added to the spreadsheet - and on that front, we're in luck - the code is all there anyway, it just needs to be tweaked (by me) to be usable beyond the worksheet function context.

Second, the problem you're experiencing re: speed and size is conceivably solvable by (not meaning to sound facetious, but) changing the size of the images. The example URLs you sent through on Amazon servers were of varying sizes - one was tiny and one was gargantuan (<-an underused word). Depending on what your needs are, what we could do is create thumbnail/smaller versions of the downloaded photos if they happen exceed certain width/height dimensions. And then you could insert those thumbnail versions. Fortunately, the code for that is already written by one of the regular contributors on this forum, so it's certainly doable. It just depends on whether that is workable for your needs - if we make the images smaller, will that prove to be a problem for you?

Let me know, because I will have time to look at it (later-ish) this week if you'd like me to.
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,578
Messages
5,765,205
Members
425,266
Latest member
bishopc22

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
Top