Is it possible to insert a picture using formulas?

P

phil2401

Hi everyone, is it possible to insert a picture/image into a cell usin
formulas alone, i don't want to use macros.

For example:

If cell 'a1' contains the word "yes" then insert image "test.jpg
(stored on the c:drive) into/onto cell 'B9', if cell 'A1' contains "No
then do nothing.

I'm trying to insert a scanned signature in a jpg format into a cell i
certain requirements are met in another cell.

I know an easy way is to "insert picture from a file" but I need t
make this fully automatic on several dozen worksheets at once s
inserting manually would be a time consuming job.

Any ideas would be welcome, it may be really simple & I'm becomin
formula blind or it just can't be done without the use of macros.

Many Thanks,
Phi
 
B

Bernie Deitrick

Phil,

It just can't be done without the use of macros. Which would be quite easy,
but, hey...

HTH,
Bernie
MS Excel MVP
 
P

phil2401

Thanks for that Bernie, I was right then - my knowledge of macros at
this moment in time is very limited, you say it would be easy - would
you like to share your ideas with an example of any code, then I could
have a "play" and at least broaden my knowledge whilst at the same time
acheiving this little goal.

Many Thanks
Phil
 
B

Bernie Deitrick

Phil,

Copy the code below, right-click on the sheet tab where you want all this to happen, select "View
Code", and paste the code into the window that appears. Change the file path and file name to your
actual values.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count <> 1 Then Exit Sub
If Target.Address <> "$A$1" Then Exit Sub
If Target.Value = "Yes" Then
Application.ScreenUpdating = False
Range("B9").Select
ActiveSheet.Pictures.Insert( _
"C:\Documents and Settings\PHIL\My Documents\My Pictures\test.jpg").Select
Selection.Name = "PictureName"
Range("A2").Select
Application.ScreenUpdating = True
Else
On Error Resume Next
ActiveSheet.Shapes("PictureName").Delete
End If
End Sub
 
P

phil2401

Bernie,

Fantastic!, although it may be simple to you I can see I have a lon
way to go...this is exactly what I wanted and I'm very grateful.

I'll peruse the coding and try to work out exactly what does what an
in what order.

Just let me take this opportunity to thank you for your help, input an
prompt reply, it's people like you that make these Forums worthwhile
again Thanks.


Best Regards,
Phi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top