Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi to all!
I've inserted one image via Insert/image/from file. I've created as well a button, this commandbutton has this code: ActiveSheet.Shapes("Picture 1").Select Selection.ShapeRange.Visible = False and the image (of course) disappear. With another commandbutton, I want this image to appear again, I've written this code: ActiveSheet.Shapes("Picture 1").Select Selection.ShapeRange.Visible = True This last code doesn't work, because there is not "picture 1" to select. How can I make this image to appear again? Thanks to all!! -- atrep |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You don't need to select it:
ActiveSheet.Shapes("Picture 1").Visible = False ActiveSheet.Shapes("Picture 1").Visible = True cheers Carlo On Jan 10, 5:34*pm, xavi garriga wrote: Hi to all! I've inserted one image via Insert/image/from file. I've created as well a button, this commandbutton has this code: ActiveSheet.Shapes("Picture 1").Select Selection.ShapeRange.Visible = False and the image (of course) disappear. With another commandbutton, I want this image to appear again, I've written this code: ActiveSheet.Shapes("Picture 1").Select Selection.ShapeRange.Visible = True This last code doesn't work, because there is not "picture 1" to select. How can I make this image to appear again? Thanks to all!! -- atrep |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is no need to select, and no need for ShapeRange
ActiveSheet.Shapes("Picture 1").Visible = False and ActiveSheet.Shapes("Picture 1").Visible = True But you can do it all with one commandbutton With ActiveSheet.Shapes("Picture 1") .Visible = Not .Visible End With -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "xavi garriga" wrote in message ... Hi to all! I've inserted one image via Insert/image/from file. I've created as well a button, this commandbutton has this code: ActiveSheet.Shapes("Picture 1").Select Selection.ShapeRange.Visible = False and the image (of course) disappear. With another commandbutton, I want this image to appear again, I've written this code: ActiveSheet.Shapes("Picture 1").Select Selection.ShapeRange.Visible = True This last code doesn't work, because there is not "picture 1" to select. How can I make this image to appear again? Thanks to all!! -- atrep |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you!
-- atrep "Bob Phillips" wrote: There is no need to select, and no need for ShapeRange ActiveSheet.Shapes("Picture 1").Visible = False and ActiveSheet.Shapes("Picture 1").Visible = True But you can do it all with one commandbutton With ActiveSheet.Shapes("Picture 1") .Visible = Not .Visible End With -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "xavi garriga" wrote in message ... Hi to all! I've inserted one image via Insert/image/from file. I've created as well a button, this commandbutton has this code: ActiveSheet.Shapes("Picture 1").Select Selection.ShapeRange.Visible = False and the image (of course) disappear. With another commandbutton, I want this image to appear again, I've written this code: ActiveSheet.Shapes("Picture 1").Select Selection.ShapeRange.Visible = True This last code doesn't work, because there is not "picture 1" to select. How can I make this image to appear again? Thanks to all!! -- atrep |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Wrong code? | Excel Programming | |||
what is wrong with this code? | Excel Programming | |||
What's wrong with this code? | Excel Programming | |||
What's wrong with this code??? | Excel Programming | |||
What's wrong w/my code? | Excel Programming |