Results 1 to 2 of 2

Thread: Save Processed Files Into Different Another Folder

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    6
    Rep Power
    0

    Save Processed Files Into Different Another Folder

    I have following code: i Want to save the processed files into different folders.but in my code it is saving all files in one folder.How can i make the changes in my code to refelect all processed files in differnet folders
    .


    =========================
    Code:
    Sub rrr()
    '
    ' rrr Macro
    '
    ' Keyboard Shortcut: Ctrl+r
    '
    
    
     
    '
    ' rrr Macro
    '
    ' Keyboard Shortcut: Ctrl+r
    '
    
    
        
        'Change to the correct folder path, be sure to include the ending \
        Const strFolderPath As String = "V:\RESG\GTS\STP-OSM\SOC\DashBoard\SandBox - confidential\Data Source - practice\darshan practice\sec alert\antivirus\March\raw data\New Folder\"
        
        Dim strCurrentFile As String
      
          Dim sDateFind As String
          Dim sDateRep As String
          Dim rLastCell As Range
          Dim LR As Long
    
    
        strCurrentFile = Dir(strFolderPath & "*.csv")
        
        Application.ScreenUpdating = False
        
      
        Do
        
        With Workbooks.Open(strFolderPath & strCurrentFile)
            
        Columns("E:E").Select
        Selection.NumberFormat = "dd/mm/yy;@"
        Columns("L:L").Select
        Selection.NumberFormat = "dd/mm/yy;@"
        
       LR = Cells(Rows.Count, "L").End(xlUp).Row
      Range("L1:L" & LR) = Evaluate("IF(L1:L" & LR & "=0+""1/1/9999"",E1:E" & LR & _
                                    ",IF(LEN(L1:L" & LR & "),L1:L" & LR & ",""""))")
     
          
        Columns("J:J").Select
        Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
        Columns("I:I").Select
        Selection.TextToColumns Destination:=Range("I1"), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
            Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
            :=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
            
            
            
            Workbooks.SaveAs FileName:= _
    "P:\D2\macros\new act\"
           .Close True
          
    Workbooks.SaveAs FileName:= _
    "P:\D2\macros\new act\"
    
    End With
            strCurrentFile = Dir
          Loop While Len(strCurrentFile) > 0
        
        Application.ScreenUpdating = True
        
    
    MsgBox "Data formatting is completed successfully!!!!"
               
           
    End Sub
    Last edited by Excel Fox; 03-22-2013 at 07:10 PM. Reason: Code Tags Added

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Please ask separate questions in new threads, and do not continue with an existing thread, unless there is a clear need to ask another question that pertains to the original query.

    Also, please use code tags to wrap your codes. Thank you for maintaining the forum decorum.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Save Worksheets As New File To Specific Folder
    By k0st4din in forum Excel Help
    Replies: 18
    Last Post: 06-08-2013, 04:24 PM
  2. Replies: 1
    Last Post: 05-21-2013, 11:58 AM
  3. HOW TO Save Processed Files Into Different Folders
    By DARSHANKmandya in forum Outlook Help
    Replies: 6
    Last Post: 04-10-2013, 07:29 PM
  4. Date References to save files using VBA Code
    By mrmmickle1 in forum Excel Help
    Replies: 3
    Last Post: 11-28-2012, 05:48 PM
  5. List Of All Files In A Folder
    By Excel Fox in forum Excel Help
    Replies: 2
    Last Post: 10-27-2011, 09:10 AM

Posting Permissions

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