|
程序里面有loop,但是一直提示没有loop。
Sub 导出图纸()
Dim i, j$, path, op, NM
i = 7
With Sheets("sheet1")
NM = .Range("d1")
End With
path = ThisWorkbook.path & "\" & NM & "-" & Format(Date, "yyyymmdd") & "\" & "图纸"
op = ThisWorkbook.Sheets("sheet1").Range("M3").Value
Application.DisplayAlerts = False
Do While Sheets("sheet1").Cells(i, "L").Value <> ""
If Sheets("sheet1").Cells(i, "L").Value = "有图" Then
With Sheets("sheet1")
j = .Cells(i, "d") & .Cells(i, "c")
End With
If Len(Dir([op\j.dwg])) = 0 Then
MsgBox "j.dwg 图纸不存在"
Else
If Sheets("sheet1").Cells(i, "k").Value = "冷轧件" Then
FileCopy op & "\" & j & ".dwg", path & "\" & "冷轧件" & "\" & j & ".dwg"
FileCopy op & "\" & j & ".pdf", path & "\" & "冷轧件" & "\" & j & ".pdf"
End If
End If
End If
i = i + 1
Loop
Application.DisplayAlerts = True
MsgBox "完成!"
End Sub
|
|