Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Help to rename files

Is there a way I can rename files:

AFT.11.DAT
AFT.12.DAT
AFT.21.DAT
AFT.22.DAT
(not the 2 "dots")

to

SEG11.DAT
SEG12.DAT
SEG21.DAT
SEG22.DAT

Thanks
Hilton


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Help to rename files

Why don't you just change the names? What is the issue here?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Hilton" wrote in message
...
Is there a way I can rename files:

AFT.11.DAT
AFT.12.DAT
AFT.21.DAT
AFT.22.DAT
(not the 2 "dots")

to

SEG11.DAT
SEG12.DAT
SEG21.DAT
SEG22.DAT

Thanks
Hilton




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Help to rename files

Assume source data in A1 down
In B1: =SUBSTITUTE(A1,"AFT.","SEG")
Copy down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Hilton" wrote:
Is there a way I can rename files:

AFT.11.DAT
AFT.12.DAT
AFT.21.DAT
AFT.22.DAT
(not the 2 "dots")

to

SEG11.DAT
SEG12.DAT
SEG21.DAT
SEG22.DAT

Thanks
Hilton



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Help to rename files

Modify this to rename instead of move. Something like this. TEST
oldname = "C:\x\" & FN
newname = "C:\y\" & "Sig"& right(FN,len(fn)-3)



Sub Movefiles()

Application.ScreenUpdating = False
Dim FN As String
FileLocation = "c:\x\*.xls"
FN = Dir(FileLocation)
Do Until FN = ""

If Mid(FN, 4, 1) = "_" Then
oldname = "C:\x\" & FN
newname = "C:\y\" & FN
Name oldname As newname
End If
FN = Dir
Loop
Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Hilton" wrote in message
...
Is there a way I can rename files:

AFT.11.DAT
AFT.12.DAT
AFT.21.DAT
AFT.22.DAT
(not the 2 "dots")

to

SEG11.DAT
SEG12.DAT
SEG21.DAT
SEG22.DAT

Thanks
Hilton



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Help to rename files

=REPLACE(A1,1,4,"SEG")


"Hilton" wrote:

Is there a way I can rename files:

AFT.11.DAT
AFT.12.DAT
AFT.21.DAT
AFT.22.DAT
(not the 2 "dots")

to

SEG11.DAT
SEG12.DAT
SEG21.DAT
SEG22.DAT

Thanks
Hilton





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Help to rename files

Don Guillett
Microsoft MVP Excel


Congratulations, Don ! cheers.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Help to rename files

Glad I understood what you wanted.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Max" wrote in message
...
Don Guillett
Microsoft MVP Excel


Congratulations, Don ! cheers.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Help to rename files

"Don Guillett" wrote in message
...
Glad I understood what you wanted.


Nope, I don't think so.
Only the OP, Hilton, can answer that.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


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
How to create a copy of a folder having five files in it, & rename Matthews Excel Worksheet Functions 1 November 7th 06 03:42 PM
Rename Text Box Ryan Excel Discussion (Misc queries) 3 March 15th 06 03:55 PM
Rename Add-Ins BEEJAY Excel Discussion (Misc queries) 4 December 8th 05 08:18 PM
how do I rename a sheet jonwyn New Users to Excel 2 March 1st 05 08:36 PM
Rename Cells dlaatsch Excel Discussion (Misc queries) 2 December 15th 04 03:27 PM


All times are GMT +1. The time now is 05:46 AM.

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

About Us

"It's about Microsoft Excel"