+ Reply to Thread
Results 1 to 7 of 7

Automation of copying data from other file

  1. #1
    Registered User
    Join Date
    04-01-2015
    Location
    Mlawa
    MS-Off Ver
    13
    Posts
    19

    Automation of copying data from other file

    Hi,

    I would like to automate the entire process, which unfortunately takes some time when manually copying data. I have two files:
    1. "Daily Production Plan" from which data will be copied
    2. "Seq plan" to which the data will be copied

    Sequence plan BM01 in file "Plan seq" = column "A" and value A01 in file "Daily Production Plan"
    Sequence plan BM02 = column "A" and value A02
    e.t.c.

    The problem is to copy the values ​​from the columns "C", "D" and depending on the day "AE", "AF" etc. from the "Daily Production Plan" file to the columns "B", "C" and "F" respectively of the file "Plan seq"
    (note - the first item from the next day should also be copied (ie the item from 10.08 is pasted into lines from 09.08) but only columns "C" and "D" from the "Daily Production Plan" file to columns "B" and "C" ). And so for the following days and the rest of the tabs. (marked in yellow in the example file).

    Note: If there is no comment in the "Daily Production Plan" file in the "J" column, then in the "Plan seq" file in the "H" column for a specific WO value, enter the same as in the "F" column. (marked in green in the example file)

    Problem: There are 10 lines for each day, if there are too few lines in the "Plan seq" file for each day, can you write the macro so that it adds another line and then copies the data?

    Both files will be in the same folder, the names can be as above (if necessary)

    In the "Plan seq" file I completed the first tab with the final effect.


    Thank you in advance for your help
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Automation of copying data from other file

    Hi Seeboo,

    Is it only up to "Sequence plan BM10" = "A10" ? What about lines C01_B & C02 from Daily Production Plan ? Where should these be updated ?

  3. #3
    Registered User
    Join Date
    04-01-2015
    Location
    Mlawa
    MS-Off Ver
    13
    Posts
    19
    Quote Originally Posted by nankw83 View Post
    Hi Seeboo,

    Is it only up to "Sequence plan BM10" = "A10" ? What about lines C01_B & C02 from Daily Production Plan ? Where should these be updated ?
    These two lines do not matter. Only lines #1, #2, #3,#9, #10.

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Automation of copying data from other file

    Try below code ... Place the code in "Daily Production Plan" file & run while "Plan seq" file is closed (just ensure to change the file path)
    Please Login or Register  to view this content.
    Last edited by nankw83; 08-10-2021 at 11:27 AM. Reason: Deleted unnecessary line
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  5. #5
    Registered User
    Join Date
    04-01-2015
    Location
    Mlawa
    MS-Off Ver
    13
    Posts
    19

    Re: Automation of copying data from other file

    Hi, I changed the path like below, placed code but nothing happened when macro finished.

    Please Login or Register  to view this content.
    and I have one issue... is this possible to automatically add new day and fill data if it will appear in Daily Production Plan?
    Like on picture in attachement?
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Seeboo; 08-11-2021 at 06:52 AM.

  6. #6
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Automation of copying data from other file

    Hi Seeboo,

    I have amended couple of things in the code as shown below. Assuming you're starting with a fresh "Plan Seq" file with 10 rows for each day, try same code with the little modifications below ... I have attached the sample files I was working with, save the file & just change the file path & try it
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-01-2015
    Location
    Mlawa
    MS-Off Ver
    13
    Posts
    19

    Re: Automation of copying data from other file

    Hi nankw83,

    I opened yours sample files and in code there is some runtime error in below line:

    Please Login or Register  to view this content.
    I am sorry, it is working. After change date format in one file macro working very good.
    However I have some request:

    1. Doubled WO when quantity are for two days for the same WO. Is it possible to deleted position when quatity is 0, for example for WO 1I1D0411 on 18.08.2021 (I added photo "Doubled WO.JPG")
    2. Input 150pcs in cell like a added photo (screen.jpg)
    Attached Images Attached Images
    Last edited by Seeboo; 08-13-2021 at 09:06 AM.

+ 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. Automation of copying 3 different workbook into one with 3 sheets
    By livhu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2021, 02:44 AM
  2. [SOLVED] Excel - Word Automation - Copying data
    By Michael Staveley in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-03-2017, 04:30 AM
  3. Macro that helps copying filtered data in file A and paste to file B ?
    By achimeda in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2013, 02:14 AM
  4. Copying specific data from one file into another file
    By flyingmachine in forum Excel General
    Replies: 1
    Last Post: 11-08-2010, 11:39 AM
  5. Copying data from worksheets from one file to another sheet on another file
    By ron2k_1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2009, 10:13 AM
  6. Trouble with CSV file - data automation
    By PowerExcel in forum Excel General
    Replies: 8
    Last Post: 10-15-2009, 04:10 PM
  7. Getting Strange Automation Error in Copying the data
    By vikasbhandari in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-07-2008, 12:07 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