|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub limonet()
Dim Dic As Object, i%
Set Dic = CreateObject("scripting.dictionary")
For i = 5 To Range("C" & Rows.Count).End(xlUp).Row
If Cells(i, "C") <> "" Then Dic(Cells(i, "C") & "\" & Cells(i, "B") & "\" & Cells(i, "A") & ".xlsx") = ""
Next i
CreateObject("wscript.shell").Run "powershell (push-location " & ThisWorkbook.Path & ");('" & Join(Dic.keys(), "','") _
& "') | foreach {'begin'} {if ((test-path ($_ -replace '(.*)\\.*','$1')) -eq $false) {md ($_ -replace '(.*)\\.*','$1')}} {copy 模板.xlsx $_} {'End'}", 0
End Sub |
|