ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert picture from filename & path in sheet's cell (https://www.excelbanter.com/excel-programming/395421-insert-picture-filename-path-sheets-cell.html)

Corey

Insert picture from filename & path in sheet's cell
 
If i have a pictures filename & path (EG. Z:My Documents\Pictures\Picture 1.jpg) on a sheet in a
cell,
is it possible to using vb to have the picture(If Filename & Path are still valid that is) placed on
the sheet ?
I have code that can propmt a user for a selection of an image, but i do not know HOW/IF it can be
modified to call the Picture selection by the cells value.

Does anyone know if this is a possibility?

Corey....



Gary''s Student

Insert picture from filename & path in sheet's cell
 
Lets say that in cell B9 we have:
C:\Documents and Settings\Owner\My Documents\My Pictures\100_0061.JPG

then:

Sub cory()
Dim s As String
s = Range("B9").Value
Range("Z100").Select
ActiveSheet.Pictures.Insert(s).Select
End Sub

will get the picture and insert it near Z100.
--
Gary''s Student - gsnu200737


"Corey" wrote:

If i have a pictures filename & path (EG. Z:My Documents\Pictures\Picture 1.jpg) on a sheet in a
cell,
is it possible to using vb to have the picture(If Filename & Path are still valid that is) placed on
the sheet ?
I have code that can propmt a user for a selection of an image, but i do not know HOW/IF it can be
modified to call the Picture selection by the cells value.

Does anyone know if this is a possibility?

Corey....





All times are GMT +1. The time now is 04:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com