|
代码如下。。。。
Sub test()
Application.ScreenUpdating = False
Dim wb As Workbook, sht As Worksheet
Set wb = ThisWorkbook
Set sht = wb.Sheets("广西嘉利工作日志")
p = ThisWorkbook.Path & "\"
arr = sht.[a1].CurrentRegion
For i = 2 To UBound(arr)
n = 0
ss = arr(i, 2)
sss = arr(i, 3)
f = Dir(p & ss, vbDirectory)
If f = "" Then MkDir p & ss
s = Split(arr(i, 4), Chr(10))
For j = 0 To UBound(s)
If s(j) <> "" Then
n = n + 1
Set pic = Sheet1.Pictures.Insert(s(j))
With pic
.CopyPicture
w = .Width
h = .Height
With ActiveSheet.ChartObjects.Add(0, 0, w, h).Chart
.Parent.Select
.Paste
.Export p & ss & "\" & sss & Format(n, "000") & ".jpg"
.Parent.Delete
End With
.Delete
End With
End If
Next
Next
Application.ScreenUpdating = True
Beep
End Sub
|
评分
-
2
查看全部评分
-
|