PC Review


Reply
Thread Tools Rate Thread

Changing filenames in a folder

 
 
Pawan
Guest
Posts: n/a
 
      6th Nov 2009
Hello

have a folder with several files with different extensions. I want to
change exensions of ".cnf.xml" files to ".xls". I want to do this in excel
macro as I need to work on these files then. Is there any way to achieve this?

Thank you

Regards,
prm
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      7th Nov 2009
Try the below

Sub Macro()
Dim strFile As String, strFolder As String
strFolder = "c:\"
strFile = Dir(strFolder & "*.cnf.xml", vbNormal)
Do While strFile <> ""
Name strFolder & strFile As strFolder & Replace(strFile, ".cnf.xml", ".xls")
strFile = Dir
Loop
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Pawan" wrote:

> Hello
>
> have a folder with several files with different extensions. I want to
> change exensions of ".cnf.xml" files to ".xls". I want to do this in excel
> macro as I need to work on these files then. Is there any way to achieve this?
>
> Thank you
>
> Regards,
> prm

 
Reply With Quote
 
Pawan
Guest
Posts: n/a
 
      7th Nov 2009
Thanks Jacob.. It worked!

"Jacob Skaria" wrote:

> Try the below
>
> Sub Macro()
> Dim strFile As String, strFolder As String
> strFolder = "c:\"
> strFile = Dir(strFolder & "*.cnf.xml", vbNormal)
> Do While strFile <> ""
> Name strFolder & strFile As strFolder & Replace(strFile, ".cnf.xml", ".xls")
> strFile = Dir
> Loop
> End Sub
>
> If this post helps click Yes
> ---------------
> Jacob Skaria
>
>
> "Pawan" wrote:
>
> > Hello
> >
> > have a folder with several files with different extensions. I want to
> > change exensions of ".cnf.xml" files to ".xls". I want to do this in excel
> > macro as I need to work on these files then. Is there any way to achieve this?
> >
> > Thank you
> >
> > Regards,
> > prm

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
something is changing my filenames =?Utf-8?B?a3VydG4=?= Microsoft Dot NET 0 18th May 2007 08:13 PM
print pdf's with changing filenames in a macro cjesag@aol.com Microsoft Excel Programming 4 16th Aug 2006 03:29 AM
Filenames with Spaces changing when retreived through IE =?Utf-8?B?V0hvaXQ=?= Windows XP Internet Explorer 0 21st Mar 2006 07:59 PM
Changing 8.3 filenames without changing their full Windows filenames J44xm Freeware 15 17th Mar 2006 06:14 PM
Changing filenames using theSaveAsCopy method =?Utf-8?B?ZGF2aWRvbzIwMDU=?= Microsoft Excel Programming 1 10th Jul 2004 08:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:28 PM.