Excel naming

Because the data is in EXCEL, it is logical to write in VBA. The advantage of VBA is that the code is in EXCEL file and it is a friendly development and debugging environment. You can execute the code step by step, and check the value of variables in the middle, which is convenient for correcting the program. I initially wrote a VBA code, saved the file in XLAM format (a file with a script), and then pressed ALT+F 1 1 to enter VBA.

The code file is as follows (it is possible that the browser will steal special characters, so it must be combined with the above picture):

Option explicit

Submacro 1 ()

Fuzzy permutation, I, J, P, F.

arr = ActiveSheet。 serviceable range

For i = 2 to the lower bound (arr)

File renaming

p = " f:\ downloads \ 1 \ " & amp; arr(i, 1)

f = Dir(p & amp; "*.jpg”)

j = 1

And f<& gt ""

The names of p & ampf are p & amparr(i, 2) and amparr(i, 3) and amp Johnson Company. ".jpg "

F = direction

j = j + 1

line

Rename folder

Name p as p & arr (i, 2).

Next, I

End joint