|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Option Explicit
Sub test()
Dim ar, i&, strFileName$, strPath$, strReName$
Application.ScreenUpdating = False
ar = [A1].CurrentRegion.Value
strPath = ThisWorkbook.Path & "\职工照片\"
strFileName = Dir(strPath & "*.xls*")
For i = 2 To UBound(ar)
strFileName = strPath & ar(i, 2) & ".jpg"
strReName = strPath & ar(i, 3) & ".jpg"
If Dir(strFileName) <> "" Then
Name strFileName As strReName
End If
Next i
Application.ScreenUpdating = True
Beep
End Sub |
评分
-
1
查看全部评分
-
|