HELP--Display Picture on Cell when called

edbdelen

New Member
Joined
Jan 28, 2008
Messages
13
Hi Everyone,
First of all , thank you for the one who shared this code I got from the internet site.

I am using this code to insert, hide and display pics on a worksheet. But now I have problem on inserting more pictures...pictures can be inserted but not hiding when not needed. I want to diplay picture one at a time, as picture name is called on a cell and the rest of the pictures should be hidden. Here is the ode I got from internet. Is this code limited to certain number of pics only, how can i increase to more than hundred pictures.


Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("I4")
For Each oPic In Me.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


By the way I am using Excel 2003. Thanks.
 
Last edited:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
After duplicating an image several hundred times, I got the following error:
Run-time error '1004':
Unable to set the Visible property of the Pictures class

I replaced:
Me.Pictures.Visible = False

With:
For Each opic In Me.Pictures
opic.Visible = False
Next

That seemed to fix it on my end. Does it work for you?
 
Upvote 0

Forum statistics

Threads
1,215,813
Messages
6,127,026
Members
449,352
Latest member
Tileni

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