![]() |
Automatically resize a picture to a cell
How can I automatically resize a picture to a cell of preset width &
height? |
Automatically resize a picture to a cell
Why? A cell can not contain a picture.
John "Gpompidou" wrote in message ... How can I automatically resize a picture to a cell of preset width & height? |
Automatically resize a picture to a cell
I use this to add a picture. Maybe you can pick out the pieces you need:
Option Explicit Sub testme01() Dim myPict As Picture Dim myPictName As String myPictName = "C:\test.jpg" With ActiveSheet With .Range("a1:b9") Set myPict = .Parent.Pictures.Insert(Filename:=myPictName) myPict.Top = .Top myPict.Left = .Left myPict.Width = .Width myPict.Height = .Height myPict.Name = "Pict_" & .Cells(1).Address(0, 0) End With End With End Sub I'm not sure if you want to fix the .width or the .height, though. Manually, you could adjust its size/position by holding down the Alt key and using the grab handles. The picture will snap-to the edges of the cells. Gpompidou wrote: How can I automatically resize a picture to a cell of preset width & height? -- Dave Peterson |
All times are GMT +1. The time now is 10:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com