diankb.cn   -Excel表格教程



Excel表格-图片居中方法

使Excel表格中的所有图片居中


Sub duiqi() 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


 

使用说明: 复制以上代码↑↑


1、表格中按Alt+F11
2、插入→模块
3、复制并粘贴上面的代码
4、关闭(返回工作簿)
5、按Alt+F8执行宏“duiqi”
6、完成表格所有图片居中

使用过程中遇到问题,可联系开发者:回忆上了发条