Inserting a picture

3 views
Skip to first unread message

Mark

unread,
Nov 14, 2001, 4:40:03 AM11/14/01
to
I am wanting to insert a picture (a persons signature
which is *.gif format)into the activecell using vba and
set it to the dimensions of the cell.

Any solutions would be greatly appreciated

Mark

Mark

unread,
Nov 14, 2001, 4:40:22 AM11/14/01
to

John Walkenbach

unread,
Nov 14, 2001, 9:06:17 AM11/14/01
to
Try something like this:

Sub InsertPicture()
Dim MyCell As Range
Dim MyPicture As Picture
Set MyCell = ActiveCell
MyCell.Select
Set MyPicture = ActiveSheet.Pictures.Insert("C:\files\sig.gif")
With MyPicture.ShapeRange
.LockAspectRatio = msoFalse
.Height = MyCell.Height
.Width = MyCell.Width
End With
MyCell.Select
End Sub

Change the filename and path as necessary. This works with Excel 2002. I haven't tried it with other versions.

John Walkenbach
For Excel tips, macros, & downloads...
http://j-walk.com/ss


"Mark" <mark.wh...@ntlworld.com> wrote in message news:88d601c16cf0$55d1fae0$9be62ecf@tkmsftngxa03...

Reply all
Reply to author
Forward
0 new messages