hiding/unhiding custom button

  • Thread starter Thread starter keyur
  • Start date Start date
K

keyur

Hi!

this is wht i am trying to achieve. i have 2 custom
buttons 1 & 2 with macro 1 & 2 respc. I want button 2 to
be visible when i run macro 1. then when i run macro 2 i
want the button 2 to hide.

i used "Selection.ShapeRange.Visible = False" at the end
of macro 2 and made it True in macro 1.

i ran both of them once so the button 2 was hidden at the
end.

now when i run macro 1, it doesnt unhides n doesnt give ne
error either. but macro 2 does saying "Method 'Select' of
object 'Shape' failed". i just want to know if the button
was deleted or its still hanging out there somewhere? how
can i get it back?
 
Sub ShowShapes()
Dim shp as Shape
for each shp in Activesheet.Shapes
shp.visible = True
Next
End Sub
 
Using Selection is problematical, as the button may not be selected. Try
this instead

With ActiveSheet.Shapes("Button 1
.Visible = Not .Visible
End With

and ditto for button 2

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Back
Top