|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 复制相片()
- Dim sPath, tPath As String
- Dim M, N As Integer
- sPath = "C:\Documents and Settings\gz\桌面\相片" '根据不同起始目录,你自己修改
- tPath = "C:\Documents and Settings\gz\桌面\相片\新建文件夹" '根据不同目标目录,你自己修改
- For M = 2 To Cells(Rows.Count, 1).End(3).Row
- If Dir(sPath & Cells(M, 1).Value) & ".JPG" <> "" Then
- FileCopy sPath & Cells(M, 1).Value & ".JPG", tPath & Cells(M, 1).Value & ".JPG"
- Cells(M, 2) = "己复制相片"
- Else
- Cells(M, 2) = "无相片"
- End If
- Next M
- MsgBox "处理完成", 0, ""
- End Sub
复制代码 根据不同目录,你自己修改
|
|