Macro displaying pictures

Gadked

New Member
Joined
Sep 16, 2011
Messages
1
Hi everyone,

I am really stuck and helpless facing my macro problem.
I use this code (below one) but it doesn´t read my pictures.
I inserted my pictures in excel and I display, via mathematical formulas, their name in the cell I want to see them appeared.
Does anyone know what's wrong ?
I thank you for your precious info


Sub Single_Country_Profile()
'
' Single_Country_Profile Macro
'
Worksheets("Single country profile Trd").Select

Dim oPic As Picture

Worksheets("Single country profile Trd").Pictures.Visible = False

With Range("I2")

For Each oPic In Worksheets("Single country profile Trd").Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With


End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hello,

I tried your macro and it worked fine for me.

Are you sure that the text you enter in cell I2 is exactly the same as the name of the picture?

When you insert pictures in Excel sheet they all got new names as "Picture 1", "Picture 2" and so on. In other words, the original picture filename might have changed.

BR,
perco
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,762
Members
452,940
Latest member
rootytrip

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
Back
Top