Results 1 to 6 of 6

Thread: Split Multiple workbook in a folder into separate worksheet and rename the file name with Date

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hi San R
    Thanks for the info


    Also please, try this macro, and tell me what happens for you:
    Quote Originally Posted by DocAElstein View Post
    What does this do?
    Code:
    Sub MyFileListAtMyFolder() ' 
    Dim myPathAndFiles As String
     Let myPathAndFiles = "D:\test\*.xls*" ' 
    Dim StrDirBack As String
     Let StrDirBack = Dir(myPathAndFiles, vbNormal) ' Initial file search for all Excel files - * is a wildcard, so any file like  MyFile.xlsx  or BN.xls    etc. will meet the search criteria - the file need only have  .xls  in it
        Do While Not StrDirBack = "" ' Dir will return "" if no next file is found
        Dim MyFilesList As String
         Let MyFilesList = MyFilesList & vbCr & vbLf & StrDirBack ' add a line and the next found file name to our file list
         Let StrDirBack = Dir ' If Dir is used with no arguments, then it looks for the next file with the previous serach criteria
        Loop '
     MsgBox Prompt:=MyFilesList, Title:="My Files from  " & myPathAndFiles
    End Sub
    Does it list all the files you need?

    Alan
    Last edited by DocAElstein; 04-27-2020 at 01:07 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Split Workbook into Separate Workbooks VBA
    By Admin in forum Download Center
    Replies: 12
    Last Post: 08-08-2018, 09:33 PM
  2. Replies: 0
    Last Post: 10-03-2013, 01:54 AM
  3. Replies: 4
    Last Post: 06-20-2013, 04:25 PM
  4. Split Workbook In To Sheets, Export To Folder and Move File
    By doug@powerstroke.us in forum Excel Help
    Replies: 2
    Last Post: 05-22-2013, 06:45 PM
  5. Replies: 12
    Last Post: 08-19-2012, 06:17 PM

Posting Permissions

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