ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Insert, position, and resize a picture w/ Macro (https://www.excelbanter.com/excel-discussion-misc-queries/149634-insert-position-resize-picture-w-macro.html)

John

Insert, position, and resize a picture w/ Macro
 
I'm completely out of my league here. I can do most basic functions when
dealing with macros, but I need to insert a picture to a specific place in a
document. Then, I need to resize it down to half the current size of the
picture.

Can anyone help me figure out how to get a macro to do that in Excel 2003?

Thanks!
John

Ron de Bruin

Insert, position, and resize a picture w/ Macro
 
You can try this
you see it will make the picture the same size as the cell now.
If you know how gig you want it you can fill in the width and height in the code

Sub Test()
Dim myPict As Picture

With ActiveSheet.Range("C1")
Set myPict = .Parent.Pictures.Insert("C:\ron.png")
myPict.Top = .Top
myPict.Width = .Width
myPict.Height = .Height
myPict.Left = .Left
myPict.Placement = xlMoveAndSize
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"John" wrote in message ...
I'm completely out of my league here. I can do most basic functions when
dealing with macros, but I need to insert a picture to a specific place in a
document. Then, I need to resize it down to half the current size of the
picture.

Can anyone help me figure out how to get a macro to do that in Excel 2003?

Thanks!
John



All times are GMT +1. The time now is 07:51 PM.

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