![]() |
|
#2
|
|||
|
|||
|
Code:
Sub TestInsertPictureInCell()
InsertPictureInRange "D:\Happy1.jpg", Range("A1")
End Sub
Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range)
Dim p As Object
If Dir(PictureFileName) = "" Then Exit Sub
Set p = ActiveSheet.Pictures.Insert(PictureFileName)
With TargetCells
p.Top = .Top
p.Left = .Left
.ColumnWidth = .ColumnWidth / .Width * p.Width
.RowHeight = p.Height ' < 409 pixels
End With
Set p = Nothing
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Referencing a Captioned Picture | ComcoDG | Word | 0 | 11-10-2008 04:40 PM |
| Drop down box in a cell | Grapejuice | Excel | 0 | 10-22-2007 07:40 PM |
| highlight cell after checkbox | flatk | Word | 0 | 01-25-2007 12:32 PM |
| click a cell to go to a worksheet | victor | Excel | 0 | 10-27-2006 02:57 PM |
| Picture Button in Outlook Contact Form | Ahmad Dorji | Outlook | 0 | 02-17-2006 05:06 PM |