Forum

Notifications
Clear all

Make chart data labels an image from the spreadsheet

13 Posts
3 Users
0 Reactions
463 Views
(@robls)
Posts: 6
Active Member
Topic starter
 

Not sure if this is possible.
If I have a number in cell A2, and an image I am bringing in from web using the Image function in cell B2, how would I make a chart data label using the image from B2?
When I use "Value from Cells" it returns the word "Picture".
This is the link I am using in the Image function " "

Thanks for any help.

 
Posted : 10/01/2024 9:25 am
(@keebellah)
Posts: 373
Reputable Member
 

Hi Robert,

The value your are looking for is not the cell value but the shape's name.

The routine you're using to shows the shape and gives it the name picture, so what you need to do is either give that range the name you want it and show the shape in that range name or rename the picture to PG 

Can you also tell us wihich version of Excel you're using?

 
Posted : 11/01/2024 2:55 am
(@debaser)
Posts: 837
Member Moderator
 

I don't think you can link them. You can copy and paste the image from the sheet to use as the picture fill for a data point, but it's static. You could also use a linked picture instead, but it won't move with the chart data point.

 
Posted : 11/01/2024 5:19 am
(@robls)
Posts: 6
Active Member
Topic starter
 

Sorry for the late reply back. Power has been out since early afternoon yesterday because of high winds.
I am using Microsoft 365 Family edition which is all up to date.
Hans, could you please explain to me in easy step-by-step instructions what you mean? I am a retiree, and not a Excel expert. Thanks.
I actually have 20 number values in column A, with corresponding Image functions in column B.
Like this:
Column A  Column B
3.50          PG
2.75          JNJ
etc...

Thanks again for the replies.

 
Posted : 11/01/2024 8:56 am
(@keebellah)
Posts: 373
Reputable Member
 

Hi Robert,

What you have to realize is that when you insert a picture in any sheet, range or cell, Excel gives it a new name.

The first one will be Picture 1, next Picture 2, etc.
Say you delete Picture 2 and you add a new one then the new one will be named Picture 3 because you're still in the same Excel instance.

If you actually want to give these pictures 'real names' you will have to use VBA which is the programming language for macro code; Visual Basic for Applications

I know there are limitations for VBA in Office 365 but a regular macro should work.

You can read this article on the forum Personal Macro Workbook - Create Your PERSONAL.XLSB (myonlinetraininghub.com)

You can also always rename the picture or shape by selecting it and change it in the top right corner name box where you will see th current name like Picture 2 or similar

I hope I have been able to pass my ideas across but feel free to ask, it will sound like abracadabra but once you look into it a little bit more you will be able to grasp the idea.

I'm still learning and a retiree (74) too 

 
Posted : 12/01/2024 3:12 am
(@robls)
Posts: 6
Active Member
Topic starter
 

Hi Hans,

Have to brush up on my skills I quess.

You wrote "You can also always rename the picture or shape by selecting it and change it in the top right corner name box where you will see the current name like Picture 2 or similar". 
Did you mean top "left" corner name box? Cell B2 would be "Logo1", cell B3 would be "Logo2", and so on...

Thanks.

Rob

 
Posted : 12/01/2024 8:35 am
(@keebellah)
Posts: 373
Reputable Member
 

Yes, the name box, there you can also see which name excel generated for the new image, that's why I always use macro's.

 

I'll try and see if I can come up with something you can use

 
Posted : 13/01/2024 4:08 am
(@debaser)
Posts: 837
Member Moderator
 

Using the IMAGE function is not the same as inserting a picture on a sheet. You cannot select or name the picture as it is a function result, not a shape.

 
Posted : 13/01/2024 5:17 am
(@robls)
Posts: 6
Active Member
Topic starter
 

Just placed a hold on a Excel and Power BI Dax book at my local library.
Let the learning journey begin.

Thanks, Hans. Would appreciate some help on writing the VBA code.

 
Posted : 13/01/2024 8:40 am
(@keebellah)
Posts: 373
Reputable Member
 

Just give me some time to place the code I am currrently using in a sample file.

Will try to complete it this weekend.

I honestly never took the time to learn from books (impatience) I have alwaye done my programming 'live' trial and error, it started in 1983 with HPBasic , later dBase (Asthon Tate) and as time went by macros in Excel to what now is VBA.

Still learning and enjoying it 

 
Posted : 14/01/2024 3:01 am
(@robls)
Posts: 6
Active Member
Topic starter
 

Hans, no hurry on the code. Never was able to do programming. Just never took hold. Started back in the day with VB. Same deal. Thanks again for your help.

 
Posted : 14/01/2024 10:58 am
(@keebellah)
Posts: 373
Reputable Member
 

Just a tryout to place a logo from a link in the particular range.

Place the entire url in column D as in the sample an the click the green button

The code is incomplte since it does not rename the picture and does not place anything in the cell where picture is placed but this is the idea, that in your version accepts the macros will probably help you

 
Posted : 14/01/2024 6:05 pm
(@robls)
Posts: 6
Active Member
Topic starter
 

Thanks, Hans will check it out.

 
Posted : 15/01/2024 9:30 am
Share: