+ Reply to Thread
Results 1 to 2 of 2

Rename Files in Folder - Change Date Format

Hybrid View

  1. #1
    Registered User
    Join Date
    10-24-2011
    Location
    Atlanta, Georgia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Rename Files in Folder - Change Date Format

    I am brand new to programming and have read two text books on it and am having difficulty figuring out how to do this. I have files saved with the mm-dd-yy date format, and I want to rename the files with the yyyy-mm-dd date format. I have created a spreadsheet with the first column with all the dates from 9-1-10 - 10-31-11. The second column has the same dates in the new date format. There isn't a file with every date in that range.

    Any suggestions?

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Rename Files in Folder - Change Date Format

    Assuming the filenames contain only a date & an extension.
    Sub snb()
      c00="E:\OF\"
      c01 =dir(c00 & "*-10*.*)
     
      do until c01=""
        name c00 & c01 as c00 & format(cdate(split(c01,".")(0)),"yyyy-mm-dd.") & split(c01,".")(1)
        c01=dir
      loop
    End Sub



+ 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