本文是教大家如何導(dǎo)出Excel里的圖片和一些小操作,凍結(jié)屏幕刷新、狀態(tài)欄動(dòng)態(tài)顯示程序進(jìn)度以及如何創(chuàng)建文件夾等。廢話不說(shuō),上代碼。 Sub 導(dǎo)出() Application.ScreenUpdating = False Dim strPath$, i&, ad$, sh, cht On Error Resume Next MkDir ThisWorkbook.Path & '\pic\' strPath = ThisWorkbook.Path & '\' For Each pic In ActiveSheet.Shapes js = js + 1 If pic.Name <> '按鈕' Then ad = pic.TopLeftCell.Address pic.Select pic.CopyPicture Set cht = ActiveSheet.ChartObjects.Add(0, 0, 50, 50) With cht .Chart.ChartArea.Select .Chart.Paste .Chart.Shapes(1).Height = 50 .Chart.Shapes(1).Width = 50 .Chart.Export (strPath & 'pic\' & Range(ad).Offset(0, -1).Value & '.jpg') .Delete End With End If DoEvents Application.StatusBar = '正在處理' & Format(js / ActiveSheet.Shapes.Count, '0.00%') Next MsgBox 'ok!' Application.StatusBar = '' Application.ScreenUpdating = True End Sub
|
|
來(lái)自: 滿泉ca85upjdlw > 《Excel知識(shí)》