第1个回答 2009-11-14
用宏(VBA)还是VB啊
这个是用宏写的,只写了A1的调整A1时图片可以自动缩放
Sub Macro1()
Range("A1").Select
ActiveSheet.Pictures.Insert("c:\图片\a.bmp").Select
With Selection
.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.Height = Worksheets(1).Cells(1, 1).Height
.ShapeRange.Width = Worksheets(1).Cells(1, 1).Width
.ShapeRange.IncrementLeft 0
.ShapeRange.IncrementTop 0
.Placement = xlMoveAndSize
End With
End Sub本回答被网友采纳
第2个回答 2009-11-22
''插图
xx = 5
Do While (xx <= i)
strMiddle1 = xlsSheet.Cells(xx, 5)
If (PathFileExists("C:\\Kuanhao\\" + strMiddle1 + ".jpg")) Then
Left = xlsSheet.Cells(xx, 5).Left + 5
Top = xlsSheet.Cells(xx, 5).Top + 5
Set oPic = xlsSheet.Pictures.Insert("C:\\Kuanhao\\" + strMiddle1 + ".jpg") '
'调整位置
oPic.Top = Top
oPic.Left = Left
oPic.Width = Width
oPic.Height = Height
Set oPic = Nothing
''xlsSheet.Shapes.AddShape(msoShapeRectangle, Left, Top, Width, Height).Fill.UserPicture ("C:\\Kuanhao\\" + strMiddle1 + ".jpg")
End If
xx = xx + 6
Loop
第3个回答 2009-11-12
Worksheets(1).Pictures.Insert(strPicname).Select
Set rng = Worksheets(1).Cells(i, 1)
With Selection
.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.Height = rng.Height
.ShapeRange.Width = rng.Width
.Top = rng.Top + 1
.Left = rng.Left + 1
End With
其中strPicname为包含完整路径的图片名称
看下完整的代码,Hi你了。
第4个回答 2009-11-11
EXCEL内的图片只能是悬浮的吧?不管谁跟着谁变都不可能吧