Find a picture on a worksheet

  • Thread starter Thread starter MM User
  • Start date Start date
M

MM User

Hi,

I it possible to serach for a picture on a worksheet via VBA, I'm trying to
see if a particular picture is visible on a worksheet if not then copy from
another another worksheet?

Thanks!
 
Maybe...

Do you know the name of the picture--not the filename that you used to insert
the picture--the name that appears in the namebox (to the left of the
formulabar) when you select that picture.

Or maybe by its location???
 
You can use something like:

dim myPict as Picture

set mypict = nothing
on error resume next
set mypict = worksheets("Somesheetnamehere").pictures("Panel1")
on error goto 0

if mypict is nothing then
'it's not there
else
'it's already there
if mypict.visible = false then
'make it visible???
mypict.visible = true
end if
end if
 
Thanks Dave, thats what I was after!

Dave Peterson said:
You can use something like:

dim myPict as Picture

set mypict = nothing
on error resume next
set mypict = worksheets("Somesheetnamehere").pictures("Panel1")
on error goto 0

if mypict is nothing then
'it's not there
else
'it's already there
if mypict.visible = false then
'make it visible???
mypict.visible = true
end if
end if
 
Back
Top