一起来学office,提高办公技能
Sub Rename()
Application.ScreenUpdating = False
On Error Resume Next
MkDir ThisWorkbook.Path & "\图片"
For Each pic In Shapes
If pic.Type = msoPicture Then
RN = pic.TopLeftCell.Offset(0, -3).Value '重命名图片
pic.Copy
With ActiveSheet.ChartObjects.Add(0, 0, pic.Width, pic.Height).Chart '创建图片
.Parent.Select
.Paste
.Export ThisWorkbook.Path & "\图片\" & RN & ".jpg"
.Parent.Delete
End With
End If
Next
MsgBox "导出图片完成!"
Application.ScreenUpdating = True
End Sub
Excel | VBA(9)—与所选单元格相同的行自动添加颜色,核查数据如此方便
Excel | VBA(8)——工作表输入数据自动加边框,删除数据自动去除边框
Excel | VBA(7)--根据订单号跨多工作表查询数据
Excel | VBA(6)——一对多查询,几行代码代替复杂公式
联系客服