MrExcel Publishing
Your One Stop for Excel Tips & Solutions

linking images to cell address

Posted by Trevor on August 24, 2001 5:58 PM

Is there a simple means of linking an image control to a cell address, so that if I change the image file name and address in a linked cell the image will change accordingly.

tia trevor

Posted by Damon Ostrander on August 26, 2001 10:44 PM

Hi Trevor,

Yes, it is easily done. Just change the file that the picture is loaded to the form from. Here is an example of loading it with the form's initialize event from cell C2 on the active worksheet:

Private Sub UserForm_Initialize()
Image1.Picture = LoadPicture([c2].Value)
End Sub

Of course, this would only update the picture on loading the form, but you could update it any time (e.g., on a button click).


Posted by Trevor D on August 28, 2001 2:15 AM

Giday Damon.

U have made my day, plus opened my eyes!.

Hi Trevor,