Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
using excel to rename filenames?
Is it possible to rename a group of filenames using Excel 2000? I have
a column of current filenames and an adjacent column of the desired new filenames. All files to be changed are in the same folder as the Excel file. Thanks! |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
using excel to rename filenames?
This worked for me--but test it against a folder with not much in it--just in
case: Option Explicit Sub testme() Dim myPath As String Dim myCell As Range Dim myRng As Range myPath = ThisWorkbook.Path & "\" With ActiveSheet For Each myCell In .Range("a2", .Cells(.Rows.Count, "A").End(xlUp)) On Error Resume Next Name myPath & myCell.Value As myPath & myCell.Offset(0, 1).Value If Err.Number = 0 Then myCell.Offset(0, 2).Value = "Ok" Else myCell.Offset(0, 2).Value = "Failed to rename" Err.Clear End If On Error GoTo 0 Next myCell End With End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm vmorgan wrote: Is it possible to rename a group of filenames using Excel 2000? I have a column of current filenames and an adjacent column of the desired new filenames. All files to be changed are in the same folder as the Excel file. Thanks! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open Excel 2003 from Windows Explorer | Excel Discussion (Misc queries) | |||
Microsoft Excel in Microsoft works - how to open | Excel Discussion (Misc queries) | |||
In Excel, how do I rename the gray rows/columns (1,2,3/A,B,C)? | Excel Discussion (Misc queries) | |||
Stop Excel Rounding Dates | Excel Discussion (Misc queries) | |||
I cannot rename my excel sheet? | Excel Worksheet Functions |