将csv中列出的旧文件重命名为新文件

我有一个两列的Excel / CSV文件。 第一个是文件的名称,第二列是我想要命名的。 Excel / CSV文件和PDF文件在同一个文件夹中

我怎样才能用最less的编程来做到这一点。 我不是编码器。

Column 1 Column 2 old1 New 1 old2 New 2 odl3 New 3 

如果这使得它更容易,我总是可以在Excel中追加名称前面的文件path

谢谢

您必须提供文件所在的path以及扩展名。 那么你最终可能会在VBA中做这样的事情。

 Sub NameFiles() Dim Path = "c:\temp\" 'keep the backslash at the end dim a as range dim x as long x = 2 For each a in Range("a2:a4") OldName = a.value 'make sure your column contains name with file extension. NewName = cells(x,2).value 'make sure your new column has extensions also Name Path & OldName As Path & NewName x = x + 1 next a End Sub