+ Reply to Thread
Results 1 to 29 of 29

Move Folder from Path to another Path

  1. #1
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Exclamation Move Folder from Path to another Path

    Edit.: Solved
    Last edited by RikNazareth; 08-07-2017 at 05:53 AM. Reason: wrong code

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Hi RikNazareth

    Welcome to the forum.
    If I understand your request correctly, i.e. You have a list of filenames in a column that are stored in a Folder.you want this entire file list to be moved to a folder that you choose via a picker. if so, this code does just that.
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Hello @sintek

    Thank You, first off all.

    I try the code u made, but i got some problems:

    - The code isn't founding the numbers or names at column A, so it canīt copy it. And for every range he ready, he is giving the error:

    http://imgur.com/a/4A3U3

    Please Login or Register  to view this content.
    I can leave some printīs or send u if need.

    Another thing, its possibly to change the error box? Because if i put A1 to A200 i have too click 200 times at the error hehe.

    Regards

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    The code isn't founding the numbers or names at column A
    Where is the numbers or names stored if not in Range("A1:A200")

    Difficult to say without a sample file upload...

  5. #5
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Hi sintek,

    Ok let me see if i can explain it.

    Everyday we have a excel file coming whit numbers, it can be 10, but can be more then 200. We copy the number to this file (link below), for the "sheet1" column A:

    https://ufile.io/07sk0

    The code u gave me i gonna put a button there.

    After this, he goes at path "Z:\VODAFONE\Por Validar" and see if the exist a folder whit the same number(s) that are at the column A. For every number found, the code should cut & pass for the path choose (from the picker).

    If he donīt find one or more numbers, its possible that only show one error box whit the numbers not found?

    Hope i was clear about it. If u need anything else, or more information please tell me.

    Thank You

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    To attach a file, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

  7. #7
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    I upload the file sample for u too see.
    Attached Files Attached Files

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Okay, I don't know why on earth I was thinking we are moving files...
    Herewith code to move the folders...Has been tested and works...
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Its saying variable not defined:

    Untitled.png

    Anything im doing wrong?

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Sorry Just add
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Erro 13

    Untitled.jpg

  12. #12
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Move Folder from Path to another Path

    If you encounter an error click "Debug" then a yellow line will be highlighted. Copy that yellow line to let us know the position of the error ..
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  13. #13
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Its says its here:

    For i = LBound(FoldArr) To UBound(FoldArr)

    Untitled.jpg

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Tests perfectly my side...


    Edited...
    Declare i as Long!!!
    Last edited by sintek; 07-25-2017 at 12:01 PM.

  15. #15
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Edit: Same thing:

    Untitled.jpg

    Last edited by RikNazareth; 07-25-2017 at 12:10 PM.

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Did it. Same error !

    Weird !!! Can be the version of excel?

  18. #18
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Move Folder from Path to another Path

    Hello
    Try this code. I didn't change a lot and this worked fine for me
    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Hello @YasserKhalil

    Thank you for your help. But still gives the same code line error.

    Untitled.jpg

    I turn on Microsoft Scripting Runtime, still donīt work. seems so close to be working, and then so far argh !!!

    Any thing we can try to solve this?

  20. #20
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Not to sure hey...Both codes...individually...tests perfectly.
    Are you using the upload that you posted to test on...
    Is your Info in Range A1 down.....

  21. #21
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Hi,

    Im putting the code at this file, cant use forum upload because it have 2.5mb.

    I created 4 folders whit numbers, and put some files inside, and i try to send them to the other folder to test. But keeps giving the erro.

    Can u test whit this file?

    http://www.filedropper.com/vodafone-geradoramostrarn2

    Other thing is. the Z.: itīs a local harddisk, its a intranet storage we have it. dunno if that can cause the problem.
    Last edited by RikNazareth; 07-26-2017 at 05:15 AM.

  22. #22
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Found the cause...You only have one value stored in your array...Only A1.value...Hence the error...No loop to go through....
    Last edited by sintek; 07-26-2017 at 06:03 AM.

  23. #23
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Yap both codes work prefect whit more then 1 number.... OMG

    Thanks alot guys

  24. #24
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Glad we could help. thanks for rep + and please mark thread as solved...

  25. #25
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Hello again guys,

    The code is making is job, the problem now is, since we stop pass the folders one by one, we donīt check if there is files inside the folder.

    So my question is, itīs possible when i choose the path to move the folder the program make two things:

    1š This is to implement at the code working already - If the folder in column A do not exit, identify the folder, maybe create a .txt (notepad) whit the folders he didn't find.

    2š And this maybe have to be made for another button - Run the folderīs and column A is a certain path (using the picker), and check if there exist files inside. If do not exist create the .txt / msg box (something lol) whit the folder(s) that donīt have files inside.

    This will guarantee that no folder are missing at the path we choose, and if they are we quickly know which one.

    And if exist folder(s) whit no files inside, we can quickly know which one too.

    This will help a lot if possible, since we lose a lot of time whit this.

    Best Regards
    Last edited by RikNazareth; 08-03-2017 at 12:37 PM.

  26. #26
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Hello Guys,

    Anyone can help?

    Regards

  27. #27
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Here you go....This what you are looking for....creates and writes to a Txt file called Info
    Please Login or Register  to view this content.

  28. #28
    Registered User
    Join Date
    07-19-2017
    Location
    Portugal
    MS-Off Ver
    Excel 2016
    Posts
    15

    Re: Move Folder from Path to another Path

    Works :D

    Thank you very much.

  29. #29
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Move Folder from Path to another Path

    Pleasure as always...thanks for rep +

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 12-29-2015, 04:19 AM
  2. [SOLVED] Help with Macro to find full path of Folder, using input of first 4 chars of folder name
    By Anxiety in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2015, 09:02 AM
  3. How to validate an input dat folder/directory path whether the path has any spaces
    By mahendra.asapu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2015, 02:39 AM
  4. Choosing folder path (instead of file path) in VBA
    By sminter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-23-2014, 08:50 PM
  5. Code to list the folder path and sub folder path of a specific file
    By kalai1587 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2013, 03:51 AM
  6. [SOLVED] Save As Dialog Box - Default Path and File Name, User Selects Sub Folder from Default Path
    By christenprochaska in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 05:17 PM
  7. Specified folder path to select file path
    By JayEmTee91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2012, 10:38 AM

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