+ Reply to Thread
Results 1 to 10 of 10

Renaming File Name

  1. #1
    Forum Contributor
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    272

    Renaming File Name

    Hi All,

    Need macro for renaming file as following:

    Old Name = Campaign Agent Activity Report_20130320_074348

    New Name = Campaign Agent Activity Report

    Thanks in Advance

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Renaming File Name

    Isn't there an extension on that filename, too? You want to rename:

    Campaign Agent Activity Report_20130320_074348.xls
    to
    Campaign Agent Activity Report.xls
    ?

    So basically removing everything from the _ to before the .xls.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    272

    Re: Renaming File Name

    Yes this is what i m looking for

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Renaming File Name

    Do you need this done on every file in a specific folder, or only on a single file that you select each time the macro runs?

  5. #5
    Forum Contributor
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    272

    Re: Renaming File Name

    For following files only on path "C:\Users\wfm007\Downloads"

    ACD Call Details Report II_20130321_064016.csv
    ACD Call Interval Report III_20130321_071120.csv
    Callback Request Report_20130321_071123.csv

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Renaming File Name

    Are you always looking for the 3 reports and stripping off the time stamp? So it's always just these 3 files in that folder with different time stamps?

    Is that was is going on?

  7. #7
    Forum Contributor
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    272

    Re: Renaming File Name

    Yes to these files only not more then 3

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Renaming File Name

    try this then:
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    272

    Re: Renaming File Name

    Thanx a ton dear, it works

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Renaming File Name

    I have marked this thread solved for you.
    In the future please select Thread Tools from the menu above and mark the thread as solved. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1