+ Reply to Thread
Results 1 to 6 of 6

Multi sheets multi times copy to new workbook during the month?

  1. #1
    Registered User
    Join Date
    02-19-2017
    Location
    Helsinki, Finland
    MS-Off Ver
    MS Office 365
    Posts
    60

    Multi sheets multi times copy to new workbook during the month?

    Can anybody help me about VBA code? I attached here one files and one screenshots. “63 Current OLD” file is source and main file, “63 New May” file is destination file. Anyway, “63 Current OLD” file had sheets 10021, 10022, 10023, 10024, 10025 and already copied to , “63 New May” file. Today, “63 Current OLD” file have sheets 10026 to 10032 I want to copy to “63 New May” file. Tomorrow maybe sheets will create 10033 to 10040, day after tomorrow maybe create sheets 10041 to 10050. So, during the current (May) month different days sheets I want to copy to “63 New May” file.
    Next month create a new file which name will be “63 New June”. After next month new file which name will be “63 New July” etc., So, every month sheets will copy to new file many times and every month new file’s name will change. In this situations what will be code? I am not expert in VBA code. Please, help me if you can and wish.
    Thank you for your time!!!
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Multi sheets multi times copy to new workbook during the month?

    Place this code in your master file. It will create a file with the months name if one doesn't already exist. It assumes that files are in the same directory. It works by you selecting the sheets that you want to copy over.

    Please Login or Register  to view this content.
    Last edited by maniacb; 06-04-2021 at 10:00 PM. Reason: Update file creation to current month

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Multi sheets multi times copy to new workbook during the month?

    Am I understanding you right that from one file (Old) you want to copy the sheets that do not exist in the other file (New) to the other file (New).
    Will the book where you want to copy into (New) be open? If not, what is the path?
    Your picture shows 5 sheets with different names before the sheet naming starts with "100". So we need to check from the 6th sheet on if the sheet exist.

  4. #4
    Registered User
    Join Date
    02-19-2017
    Location
    Helsinki, Finland
    MS-Off Ver
    MS Office 365
    Posts
    60

    Re: Multi sheets multi times copy to new workbook during the month?

    Hello jolivanes
    Yes, old file always same, and New file will be created in a month once. Say, this month new file name will be “63 June”, next month file name will be “63 July”, after next “63 August” etc.,
    Sheets name always different, say, 10010, 10011 etc., or Chalan 0001, Chalan 0002, it can be any name. Actually, I want that in a month new file create once and sheets from old file will be copy to new file many times in a month (say, copy 20 times and maybe 100 sheets, so each day 5 sheet average). I hope now you understand.
    Thank you for your time!

  5. #5
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Multi sheets multi times copy to new workbook during the month?

    Here is an updated version. It only copies for the present day from field J10, not what you select. I believe you were looking for this functionality in your last post. It continues to create a file if the new file doesn't exist. And it will only copy sheets that don't already exists in the new file. Let us know how it works for you.

    Please Login or Register  to view this content.
    Last edited by maniacb; 06-05-2021 at 03:58 PM.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Multi sheets multi times copy to new workbook during the month?

    It sounds to me that you want to save certain files as a new workbook.
    The easiest would be to just delete the file and create a new one every time you want or delete all the sheets in the file and copy the new sheets into it.
    Do you create the file manually before or does it need to be created through the code?

+ 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. [SOLVED] Multi sheets copy to a new Workbook / file
    By mazadb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-02-2021, 01:38 AM
  2. VBA Hiding rows multi criterias code time execution issue + Copy sheets VBA error
    By hunker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2020, 12:44 AM
  3. Automatically copy data to other cells every 5 minutes, multi sheets
    By ste33uk in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-04-2020, 04:03 PM
  4. Copy Multi Rows From Multi Sheets Based On Column Value And Create New Workbooks
    By Huskersippi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2017, 04:51 PM
  5. Writing the loop for updating multi-table MS access file using multi-sheet excel
    By relabz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-29-2016, 03:10 PM
  6. Replies: 19
    Last Post: 10-05-2012, 01:03 PM
  7. Horizontal multi data 12 month rolling chart, multiple sheets.
    By allstar51788 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-29-2012, 08:53 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