LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default VBA to display image on a form - image is defined in Range Name

Sub InsertPicture(PicturePath as String, PlacementCell as Range)
' PicturePath will be the file path (from your range)
' PlacementCell is the cell where the top left of the picture will go

Dim NewPic As Object

Set NewPic = PlacementCell.Parent.Pictures.Insert(PicturePath)
NewPic.Name = "Logo" ' allows you to easily refer to the picture in the
future
' (i.e. ActiveSheet.Pictures("Logo"))
NewPic.Top = PlacementCell.Top
NewPic.Left = PlacementCell.Left

End Sub
--
- K Dales


"Tan" wrote:

I have a picture stored in a range name in an excel spreadsheet. I need a
VBA to display the logo on a form. How can I go about doing it? In the
form, do I define it as an image? If so, then how do I point the image to
the range name?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink to an image in other worksheet, displaying entire image. twilliams Excel Worksheet Functions 0 February 7th 06 10:02 PM
Display Worksheet image on a form Dave Taylor[_4_] Excel Programming 0 November 18th 04 10:10 AM
Display Worksheet image on a form Dave Taylor[_3_] Excel Programming 1 November 18th 04 02:19 AM
Export the worksheet background image as an image file - possible? DataFreakFromUtah Excel Programming 2 April 10th 04 04:49 PM
Open image from web in window same size as image? Milos Setek Excel Programming 0 February 5th 04 03:33 AM


All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"