EXCEL里面复制,然后可以粘贴为图片,你可以录制宏看一下,我之前写出过相关的代码。非常好用,如果需要,我可以分享给你。
Sub 复制区域()
Dim pic_rng As Range, name$, i%, t, d As Object, arr
Set d = CreateObject("scripting.dictionary")
arr = ThisWorkbook.Sheets(1).Range("c6:c100")
For i = 1 To 95
d(arr(i, 1)) = ""
Next i
If d.exists("") Then
d.Remove ("")
End If
'Stop
For Each t In d.keys
ThisWorkbook.Sheets(1).Rows(5).Select
Selection.AutoFilter 3, t
name = t
'Stop
Set pic_rng = ThisWorkbook.Sheets(1).UsedRange
SaveRngToJpg pic_rng, name
ThisWorkbook.Sheets(1).Rows(5).Select
Selection.AutoFilter
Next t
End Sub
Sub SaveRngToJpg(ByVal rng As Range, ByVal name As String)
'Dim rng As Range
Dim shp As Shape
Dim myFolder$
Sheet1.Activate
myFolder = ThisWorkbook.Path & "\图片\"
rng.Select
Selection.Copy
ActiveSheet.Pictures.Paste
For Each shp In ActiveSheet.Shapes
If shp.Type = 13 Then
If Len(Dir(myFolder, vbDirectory)) = 0 Then
MkDir myFolder
End If
shp.CopyPicture
With ActiveSheet.ChartObjects.Add(0, 0, shp.Width, shp.Height).Chart
.Parent.Select '必须要选择父对象chartojbect之后再粘贴,这样才能真正的粘上去。
.Paste
.Export myFolder & name & ".jpg", "JPG"
.Parent.Delete
End With
shp.Delete
End If
Next
' MsgBox ("已保存到图片文件夹下")
End Sub