click a button & have a pic popup in excel?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 

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