Make same picture appear more than once

D

dd

Hi I have the macro working for inserting different pictures but what if I
want to see the same picture output more than once without changing the
picture name.
In another worksheet, I have the a list with the name and picure number.
When the name matches the corresponding picture, it will show but for
example, if there were three of the same name only one picture will show and
the other two will be blank.

Below is the code I'm using.

Private Sub Worksheet_DD()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B16")
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
With Range("B22")
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

and continues with more coding

Thanks
 
B

Bernie Deitrick

dd,

You need to copy and paste the picture, then name it in a way that you can later delete it (so, no,
you cannot output it more than once without changing the picture's name).

I have an example workbook that shows the technique. Email me privately and I will forward it to
you. (Reply, then take out the spaces and change dot to .)

HTH,
Bernie
MS Excel MVP
 
D

dd

Bernie
I emailed you.
Thanks

Bernie Deitrick said:
dd,

You need to copy and paste the picture, then name it in a way that you can later delete it (so, no,
you cannot output it more than once without changing the picture's name).

I have an example workbook that shows the technique. Email me privately and I will forward it to
you. (Reply, then take out the spaces and change dot to .)

HTH,
Bernie
MS Excel MVP
 
T

TheSurreyChef

I am having exactly the same problem. Could you email the example worksheet.

Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top