click a button & have a pic popup in excel?

H

humblehero

I want to be able to click a button (maybe a command button) & have a pic pop
up in its own box. is that possible in excel?
 
D

Dave Peterson

Is it always the same picture?

Maybe just adding the picture and then hiding/showing whenever you need it would
suffice.

If you want to add a picture based on the user's choice:

Option Explicit
Sub testme02()

Dim myPictureName As Variant
Dim myPict As Picture
Dim myRng As Range
Dim wks As Worksheet

myPictureName = Application.GetOpenFilename _
(filefilter:="Picture Files,*.jpg;*.bmp;*.tif;*.gif")

If myPictureName = False Then
Exit Sub 'user hit cancel
End If

With Worksheets("sheet1")
Set myRng = .Range("c3:e5")
End With

For Each wks In ActiveWorkbook.Worksheets
Set myPict = wks.Pictures.Insert(myPictureName)
myPict.Top = myRng.Top
myPict.Width = myRng.Width
myPict.Height = myRng.Height
myPict.Left = myRng.Left
myPict.Placement = xlMoveAndSize
Next wks
End Sub

It depends on what you really want to do.
 
Top