need help insersing pictures into cell

rag2

New Member
Joined
Mar 24, 2009
Messages
7
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
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

rag2

New Member
Joined
Mar 24, 2009
Messages
7
i have an idea an is to creat 20 macro and use there shortcut keys to imput the picture is there any other way
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,515
Messages
5,832,199
Members
430,115
Latest member
RainerJonker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top