Renaming Files w/Excel

C

Confused VB Person

I have a simple spreadsheet with 2 columns: Column A has original file names
for a bunch of Acorbat (.pdf) files while Column B has the new filename. I
want to read each row, get the original final name from Column A, rename the
old file to the new one whose name I have specified in Column B.

Is there a simple VBA that can take care of this? Thanks in advance!
 
G

Gary''s Student

Perhaps:

Sub ordinate()
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
Name cell.Value As cell.Offset(0, 1).Value
Next cell
End Sub
 
C

Confused VB Person

Thanks for the fast response. But I forgot to mention that I use Excel in
Office2003. Will your VBA work with this version?
 
C

Confused VB Person

I ran your VBA macro and got this error message: "Run-time error 53: File not
found". My question is how do I explicitly call the file which I read from
my spreadsheet?
 
G

Gary''s Student

In cell A1 enter:
C:\Documents and Settings\Owner\Desktop\helper.xls
In cell B1 enter:
C:\Documents and Settings\Owner\Desktop\helper2.xls

and the rename is performed
 
Top