excel单元格图片居中
1.单元格内图片
Sub dq() Dim shp As Shape For Each shp In ActiveSheet.Shapes shp.Left = (shp.TopLeftCell.Width - shp.Width) / 2 + shp.TopLeftCell.Left shp.Top = (shp.TopLeftCell.Height - shp.Height) / 2 + shp.TopLeftCell.Top Next End Sub
2.合并单元格内图片
Sub dq() Dim shp As Shape For Each shp In ActiveSheet.Shapes Set picArea = shp.TopLeftCell.MergeArea shp.LockAspectRatio = False shp.Top = shp.Top shp.Left = shp.Left shp.Height = picArea.Height - 10 shp.Width = picArea.Width - 10 Next End Sub

浙公网安备 33010602011771号