+ Reply to Thread
Results 1 to 8 of 8

copy/move all auto generated ws in one folder

  1. #1
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    copy/move all auto generated ws in one folder

    Is there a way to have all the worksheets created and moved out of the original workbook all saved in one folder? the maro below works but it saves the copied worksheets in seperate folder but I want in all in one folder.

    Any advice or help will be apprcitaed;

    Please Login or Register  to view this content.
    Thanks

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: copy/move all auto generated ws in one folder

    Because you have not provided the full code, it appears that you may have something happening in the unseen code which is causing this. You have an End With without showing the start and you have two end ifs without showing the If statements. Please post the whole code for analysis.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: copy/move all auto generated ws in one folder

    This is the code,

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: copy/move all auto generated ws in one folder

    It appears to me that because this bit of code is inside the For each MyCell that you are creating a new folder with each loop of MyCell. Place the code to create the folder outside of the loop and you will probably be ok.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: copy/move all auto generated ws in one folder

    Hi Alansidman. Whe I do as you suggested by placing it after "Next MyCell" in the macro, I get a Run - time error 1004 "Microsoft Office Excel cannot access file C:\....There are several.." and it highlight

    Please Login or Register  to view this content.
    Any ideas?

    Thanks
    Last edited by Pi*; 09-13-2016 at 09:20 PM.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: copy/move all auto generated ws in one folder

    I would place it before the For Each MyCell. I am not entirely sure this will solve your issue. It just seemed logical to me.

  7. #7
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: copy/move all auto generated ws in one folder

    That was a smart and logical suggestion Alansidman! For every instance of updating/reshreshing the newly created workbook, it moves it to the folder and saves it.

    Thank You! Sir.

    PS.
    This issue is resolves but I had a side question. If any of the sheets it moves to the folder is saved as an .xlsm, will the macro in that file still work?

    Thanks again Alansidman I appreciate all the help.

    Pi*

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: copy/move all auto generated ws in one folder

    If the macro is in the saved files and saved as an .xlsm then if all conditions in the macro are met, it should work.

+ 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. Copy & Move multiple certain name specific files to another Folder.
    By kandoo1 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-22-2016, 11:02 AM
  2. unable to copy / move file from Outlook preview pane to zip folder
    By dgiardina in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 01-21-2015, 10:31 AM
  3. Copy specific data from Monthly auto generated workbook to master sheet
    By onbeillp111 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-26-2014, 12:25 PM
  4. Creating folder and filter and copy paste to a new workbook generated
    By kriahnadas.oo7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2014, 06:01 AM
  5. [SOLVED] Macro for making hyperlinks from auto generated folder dir.
    By lavinius in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-18-2013, 04:01 AM
  6. rename & copy *.xls file in the folder then move
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2011, 12:22 PM
  7. Copy and move file to a new folder: macro
    By mdaga in forum Excel General
    Replies: 2
    Last Post: 04-10-2008, 02:55 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