Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old November 28th 05, 07:26 PM posted to microsoft.public.excel.setup
G
 
Posts: n/a
Default Position Picture with macro

How do I position the picture after inserting the image through macro?

wks.Pictures.Insert ("T:\BrokerInformation\Grayson Fitch\Burn\logo_cne.gif")

Thanks!

  #2   Report Post  
Old November 28th 05, 08:25 PM posted to microsoft.public.excel.setup
Dave Peterson
 
Posts: n/a
Default Position Picture with macro

Saved from a previous post:

Option Explicit
Sub testme02()

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

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

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

With Worksheets("sheet1")
.Unprotect Password:="hi"
Set myRng = .Range("A1:e10")
Set myPict = .Pictures.Insert(myPictureName)
myPict.Top = myRng.Top
myPict.Width = myRng.Width
myPict.Height = myRng.Height
myPict.Left = myRng.Left
myPict.Placement = xlMoveAndSize
.Protect Password:="hi"
End With
End Sub

G wrote:

How do I position the picture after inserting the image through macro?

wks.Pictures.Insert ("T:\BrokerInformation\Grayson Fitch\Burn\logo_cne.gif")

Thanks!


--

Dave Peterson


Reply
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
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Copying as Picture Link - using Macro Kamal Excel Discussion (Misc queries) 3 June 30th 05 12:07 AM
Relative Cell position NOT working with or without macro Scratching my Head Excel Discussion (Misc queries) 6 May 30th 05 06:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 01:40 AM
macro problem Kevin Excel Discussion (Misc queries) 1 December 14th 04 11:47 PM


All times are GMT +1. The time now is 06:59 AM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017