ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel and Picture (https://www.excelbanter.com/excel-programming/273031-excel-picture.html)

Yaron[_2_]

Excel and Picture
 
Hi,

I want to have the option to get a picture on my excel
sheet.

I want to put the data , let say in Ceel A1
(exampel: YR255) and excel will go and find the file
(YR255.jpg) and will display it on A2

How do i do it , please help

Rob Bovey

Excel and Picture
 
Hi Yaron,

Here's one way to do it:

Sub InsertPicture()
Dim objPict As Picture
Dim szName As String
szName = Sheet1.Range("A1").Value
Set objPict = Sheet1.Pictures.Insert("E:\" & szName)
objPict.Top = Sheet1.Range("A2").Top
objPict.Left = Sheet1.Range("A2").Left
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Yaron" wrote in message
...
Hi,

I want to have the option to get a picture on my excel
sheet.

I want to put the data , let say in Ceel A1
(exampel: YR255) and excel will go and find the file
(YR255.jpg) and will display it on A2

How do i do it , please help





All times are GMT +1. The time now is 08:02 PM.

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