HDfatboy03
Board Regular
- Joined
- May 23, 2010
- Messages
- 62
Hello
I learned from an earlier post that pics can't populate thru excel with a formula.. So I found the below code to start but need some help modifying it.
In cell A9 when my friends name appears example "Chuck", I want his picture to appear in cell A11. This picture is named "Chuck.jpg" and is located C:\Mypics\college friends\
Public Sub LoadPicture()
On Error Resume Next
Shapes("MyPicture").Delete
<WBR>On Error GoTo 0
If Len([EntryCell]) > 0 Then
Set Picture = Sheets("Sheet1").Pictures.<WBR>Insert("\\<WBR>path\pictu<WBR>res\" & [EntryCell] & ".jpg")
Picture.Name = "MyPicture"
Picture.Top = [ImageArea].Top
Picture.Left = [ImageArea].Left
Picture.Width = Picture.Width * [ImageArea].Height / Picture.Height
Picture.Height = [ImageArea].Height
End If
End Sub
Any help will be greatly appreciated.
HDfatboy03
I learned from an earlier post that pics can't populate thru excel with a formula.. So I found the below code to start but need some help modifying it.
In cell A9 when my friends name appears example "Chuck", I want his picture to appear in cell A11. This picture is named "Chuck.jpg" and is located C:\Mypics\college friends\
Public Sub LoadPicture()
On Error Resume Next
Shapes("MyPicture").Delete
<WBR>On Error GoTo 0
If Len([EntryCell]) > 0 Then
Set Picture = Sheets("Sheet1").Pictures.<WBR>Insert("\\<WBR>path\pictu<WBR>res\" & [EntryCell] & ".jpg")
Picture.Name = "MyPicture"
Picture.Top = [ImageArea].Top
Picture.Left = [ImageArea].Left
Picture.Width = Picture.Width * [ImageArea].Height / Picture.Height
Picture.Height = [ImageArea].Height
End If
End Sub
Any help will be greatly appreciated.
HDfatboy03