Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Renaming Files w/Excel

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!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Renaming Files w/Excel

Perhaps:

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

--
Gary''s Student - gsnu200775


"Confused VB Person" wrote:

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!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Renaming Files w/Excel

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

"Gary''s Student" wrote:

Perhaps:

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

--
Gary''s Student - gsnu200775


"Confused VB Person" wrote:

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!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Renaming Files w/Excel

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?



"Confused VB Person" wrote:

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

"Gary''s Student" wrote:

Perhaps:

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

--
Gary''s Student - gsnu200775


"Confused VB Person" wrote:

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!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Renaming Files w/Excel

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

--
Gary''s Student - gsnu200775


"Confused VB Person" wrote:

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?



"Confused VB Person" wrote:

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

"Gary''s Student" wrote:

Perhaps:

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

--
Gary''s Student - gsnu200775


"Confused VB Person" wrote:

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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming a worksheet in excel Sudhir Amin[_2_] Excel Discussion (Misc queries) 3 January 17th 08 01:53 PM
Renaming scan files with a list of drawing names in excel spreadsh Ravi Excel Discussion (Misc queries) 1 February 8th 07 04:01 AM
Batch renaming of many worksheets in Excel files? Lumen S Excel Discussion (Misc queries) 2 August 17th 06 09:48 PM
Renaming Files Bear Excel Discussion (Misc queries) 2 December 5th 05 09:02 PM
Excel, renaming columns Treasuris Excel Worksheet Functions 1 September 27th 05 02:03 AM


All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"