|
Sub limonet()
Dim i%, Dic As Object, H$
Set Dic = CreateObject("scripting.dictionary")
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
Dic(Cells(i, "B").Value) = Dic(Cells(i, "B").Value) & "','" & Cells(i, "A") & ".jpg"
Next i
For i = 0 To Dic.Count - 1
H = H & "';'" & Dic.keys()(i) & "'=" & Mid(Dic.items()(i), 3)
Next i
CreateObject("wscript.shell").Run "powershell push-location " & ThisWorkbook.Path _
& ";$h=@{" & Mid(H, 3) & "'};md $h.keys;foreach ($i in $h.keys) { move $h[$i] $i}", 0
End Sub |
|