Pointing an image to a Named range rather than a pic file

mmcginn

New Member
Joined
Mar 14, 2011
Messages
5
Hi,

I have a macro that adds an Image(ActiveX Control) to a sheet.

Rather than pointing this towards a picture I would like to point it towards a named range therefore giving me a livefeed to a range of cells.

I have been trying to modify the following line without result. I would like to replace the file path with a named range.I have no idea how to do this or if it is possible.

Code:
Worksheets("Sheet1").Image1.Picture = LoadPicture("C:\Users\txi\Pictures\pool.gif")
Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Sorry, LoadPicture expects a reference to a file on disk.

What you can do is copy a range of cells, then hold down Shift and choose Edit|Paste Picture Link. You will get a linked picture and you can chage what it refers to by editing the formula in the Formula Bar. The reference can be a named range.
 
Upvote 0
I don't know much about VBA, but I know the indirect function allows you to point to another cell that could contain the image link. Maybe that'll help some
 
Upvote 0
Sorry are you trying to get a picture of some cells elsewhere on your spreadsheet or somewhere to appear so you can see a live version of how they change? If so just copy your cells in teh nomal way. Then in the spreadsheet where you want it to appear you go to home - paste -as picture- as picture link and it is done. I imagine you could include this as part of some VBA if you needed to by using the macro recorder but i absolutely have no idea what the syntax would be:rolleyes:.
 
Upvote 0
Sorry are you trying to get a picture of some cells elsewhere on your spreadsheet or somewhere to appear so you can see a live version of how they change?

Exactly. As the range changes I want it reflected in the Pic Object
 
Upvote 0
In that case just select the cells you want to see the "live" picture of and copy them in the normal way. Select where you want the picture to appear in your WB. Then click Paste in the Home Tab (in 2007) - then at the bottom of the menu you get select "As Picture" and then on teh next menu select Paste Picture Link. That will insert a "live" view of the original cells in the new place which will update as the cells change.

In older versions of Excel the same functionality is available through Shift&Edit - Paste Picture Link
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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