hi by the way im new here
untill now i fallow mrexcel macro to insert pic automatic.
but i have a catalog were i need to input de picture numer every time in a difrent cell and the picture need to be loaded to a cell, but that cell changes dependig on the item
for examp.
item no.= pj043
picture no.= radio Loading picture cell
item no. pj0546
picture no. = television Loading picture cell
this is what i have so far
Sub Chk_Insrt()
Dim fso As Object, MyDir As String, Nme As String, myPic As Object
Dim ws As Worksheet
Set fso = CreateObject("Scripting.FileSystemObject")
MyDir = "c:\" 'Change Directory
Nme = Sheets(1).[b16] & ".jpg" 'Change Filename
If fso.FileExists(MyDir & Nme) Then
Application.ScreenUpdating = 0
Set ws = Sheets(1) 'Change the target sheet
Set myPic = ws.Pictures.Insert(MyDir & Nme)
With myPic
.Top = ws.[g15].Top
.Left = ws.[g15].Left
.ShapeRange.Height = ws.[g15].RowHeight * 8.2 '8.2 rows tall
End With
Set myPic = Nothing: Set ws = Nothing
Application.ScreenUpdating = 1
End If
Set fso = Nothing
End Sub
can some one help get this done
thanks in advance
untill now i fallow mrexcel macro to insert pic automatic.
but i have a catalog were i need to input de picture numer every time in a difrent cell and the picture need to be loaded to a cell, but that cell changes dependig on the item
for examp.
item no.= pj043
picture no.= radio Loading picture cell
item no. pj0546
picture no. = television Loading picture cell
this is what i have so far
Sub Chk_Insrt()
Dim fso As Object, MyDir As String, Nme As String, myPic As Object
Dim ws As Worksheet
Set fso = CreateObject("Scripting.FileSystemObject")
MyDir = "c:\" 'Change Directory
Nme = Sheets(1).[b16] & ".jpg" 'Change Filename
If fso.FileExists(MyDir & Nme) Then
Application.ScreenUpdating = 0
Set ws = Sheets(1) 'Change the target sheet
Set myPic = ws.Pictures.Insert(MyDir & Nme)
With myPic
.Top = ws.[g15].Top
.Left = ws.[g15].Left
.ShapeRange.Height = ws.[g15].RowHeight * 8.2 '8.2 rows tall
End With
Set myPic = Nothing: Set ws = Nothing
Application.ScreenUpdating = 1
End If
Set fso = Nothing
End Sub
can some one help get this done
thanks in advance