Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm using this code to insert a picture and resize it to the currently
selected cell. The problem is that the picture resizes but doesn't center in the selected cell. How can I add this to my code so that picture will center to the selected cell? Sub InsertPicture() Dim myPicture As String myPicture = Application.GetOpenFilename _ ("Pictures (*.gif; *.jpg; *.bmp; *.tif),*.gif; *.jpg; *.bmp; *.tif", , "Select Picture to Import") If myPicture < "" Then ActiveSheet.Pictures.Insert (myPicture) ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Selec t With Selection ..ShapeRange.LockAspectRatio = msoFalse ..ShapeRange.Height = ActiveCell.RowHeight ..ShapeRange.Width = ActiveCell.ColumnWidth * 5.25 + 4 ..Placement = xlMoveAndSize End With End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
move picture to behind cells | Excel Worksheet Functions | |||
Macro for variable picture | Excel Discussion (Misc queries) | |||
How would I move/insert a custom picture (button) onto the toolbar | Excel Discussion (Misc queries) | |||
delete picture with macro | Excel Discussion (Misc queries) | |||
Position Picture with macro | Setting up and Configuration of Excel |