Results 1 to 13 of 13

Moving subfolders to another folder.

Threaded View

  1. #5
    Registered User
    Join Date
    06-12-2012
    Location
    Verona, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Moving subfolders to another folder.

    I am using the code below. Changing the to and from path. No action occurs when i run it. No errors either.


    Sub lwk()
        Const sDirFr    As String = "C:\Users\Lucas\Desktop\From"
        Const sDirTo    As String = "C:\Users\Lucas\Desktop\To"
        Dim sFile       As String
        Dim iRow        As Long
    
        For iRow = 2 To Cells(Rows.Count, "A")
            sFile = Cells(iRow, "A").Value2
            If Len(Dir(sDirFr & sFile)) Then
                Name sDirFr & sFile As _
                     sDirTo & sFile & " - " & Cells(iRow, "A").Value2
            End If
        Next iRow
    End Sub
    Last edited by Leith Ross; 12-21-2012 at 10:49 PM. Reason: Added Code Tags

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