ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Picture popup (https://www.excelbanter.com/excel-discussion-misc-queries/188530-picture-popup.html)

TheSAguy

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

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

Thanks.

TheSAguy

Quote:

Originally Posted by TheSAguy (Post 670076)
In Excel, What will the code be to display a picture on the screen if a button is pressed?

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

Thanks.

Anyone please??

Dave Peterson

Picture popup
 
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.

TheSAguy wrote:

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

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

Thanks.

--
TheSAguy


--

Dave Peterson


All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com