Picture popup

  • Thread starter Thread starter TheSAguy
  • Start date Start date
T

TheSAguy

In Excel, What will the code be to display a picture on the screen if
button is pressed?

I have a button, if pressed, needs to open a MsgBox or somethin
displaying a picture.

Thanks
 
TheSAguy;670076 said:
In Excel, What will the code be to display a picture on the screen if
button is pressed?

I have a button, if pressed, needs to open a MsgBox or somethin
displaying a picture.

Thanks.

Anyone please?
 
I put a button from the Forms Toolbar on the worksheet.
I added a picture named "Picture 1" right near that button.

I assigned this macro to the button:

Option Explicit
Sub testme()
Dim myPict As Picture
Set myPict = ActiveSheet.Pictures("Picture 1")
myPict.Visible = Not myPict.Visible
End Sub

Clicking the button toggles the visibility of the picture.
 

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