Results 1 to 1 of 1

Thread: Can someone help me in this scenario to download files to multiple folders.

  1. #1

    Can someone help me in this scenario to download files to multiple folders.

    Hi team, can someone help me in this scenario to download files to multiple folders.
    Like in the below code how do i change pth for every specific file to specific folder.
    Ex: i want to move few files to "OLD" folder, and some files to "NEW" folder some of them to "MODERN" folder.. how can i loop the path as well. Thanks


    Sub DownloadFile()
        pth = "C:\VBAX"
        For Each link In ActiveSheet.Hyperlinks
            fname = Split(link.Address, "/")(UBound(Split(link.Address, "/")))
            filename = pth & fname
            URLDownloadToFile 0, link.Address, filename, 0, 0
        Next link
    End Sub
    Last edited by Aussiebear; 03-12-2025 at 08:08 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
  •