Renaming Files w/Excel

  • Thread starter Thread starter Confused VB Person
  • Start date Start date
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!
 
Perhaps:

Sub ordinate()
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
Name cell.Value As cell.Offset(0, 1).Value
Next cell
End Sub
 
Thanks for the fast response. But I forgot to mention that I use Excel in
Office2003. Will your VBA work with this version?
 
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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top