Results 1 to 4 of 4

Thread: Fill Columns based on open date

  1. #1
    Junior Member
    Join Date
    Apr 2018
    Posts
    23
    Rep Power
    0

    Fill Columns based on open date

    Hi All, I need help on this. I am currently looking for a formula or VBA code to copy and paste all information from column A to M and O to S columns based on the N column open date from workbook1 to workbook2.

    There will be two scenario:
    1. If the column N in workbook 1 have a specific date (Example 10/2/2018) the formula or VBA code should bring all data from column A to M and O to S in the workbook 2.

    2. If the column N in workbook 1 have a word (Done or done). the formula or VBA code should ignore that row. also, If the date in workbook 1 have been changed to Done or done. The workbook2 should remove that data out. Please help.

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,446
    Rep Power
    10
    Hi Thai,

    _a) It is not too clear to me what you mean by “….open date…” ?
    Possibly you mean the current date at the time that the workbook is opened ?


    I expect to do something like what you want, a formula may be possible. This would probably be a quite complicated formula. I do not personally know how to do this as I do not have much experience with formulas.

    _b) It is very easy to write a VBA code which , based on the contents of a cell , copies data from one workbook to another. There are many, many ways to do this.
    One basic approach would be as follows:
    For your scenario 1. ….If the column N in workbook 1 have a specific date (Example 10/2/2018) the formula or VBA code should bring all data from column A to M and O to S in the workbook 2. ……
    Loop down column N in workbook 1. At each row, you check for the value in the cell . If you get a match to the value which you are looking for ( in your case the “specific date” ) , then the required data would be copied over to the next free row in Workbook
    For your scenario 2. …. If the date in workbook 1 have been changed to Done or done. The workbook2 should remove that data out…..
    A second looping would be done in the code to check both the data in Workbook 2 and Workbook 1 for a match in row data for the columns A to M and O to S AND a Done or done in workbook 1. If you get a match in the data for the columns A to M and O to S AND a Done or done in workbook 1 , then the entire row would be deleted from workbook 2.

    _._________________

    If you still need help with a specific example, then I think it would be best to
    _a) explain what you mean by “….open date…”
    _ b)(i) provide us with 4 sets of data, ( 2 pairs = 2x2 = 4 ) ( These can be in 4 workbooks or 4 worksheets in one workbook ). This data should show us the
    scenario 1. of workbook 1 and workbook 2 - one pair of data
    and
    scenario 2. of workbook 1 and workbook 2 – another pair of data

    ( The developed code would be just one single code to work for both scenarios: the same code should work for both pairs of data )

    An alternative to this b(i) would be :
    _ b(ii) Privide one data example for workbook 1 and two data exampes for workbook 2: a "workbook 2 before" and a "workbook 2 After" : "workbook 2 before" would be the situation just before running a code : "workbook 2 after" would be the changed situation in workbook 2 which you would want based on the data in workbook 1 and "workbook 2 before". Make sure you chose the test data carefully in order to test all possible scenarios.


    _.____


    Alan
    Last edited by DocAElstein; 10-09-2018 at 07:07 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

  3. #3
    Junior Member
    Join Date
    Apr 2018
    Posts
    23
    Rep Power
    0
    Hi Alan,
    I got all figure out. Thank you

  4. #4
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,446
    Rep Power
    10
    Hi Thai,
    Good to hear from you and that you solved your problem. Thanks for leting us know.
    Alan
    P.S. Incidentally, when you solve your own problem you can always post your solution if you want to.
    Then others with a similar problem or requirement who may see the thread on a search in the future may benefit
    Last edited by DocAElstein; 11-01-2018 at 02:00 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

Similar Threads

  1. Fill Combobox Based On Values In Adjacent Column
    By rydysh in forum Excel Help
    Replies: 5
    Last Post: 10-03-2013, 07:27 AM
  2. Replies: 1
    Last Post: 08-20-2013, 04:31 PM
  3. Replies: 9
    Last Post: 08-02-2013, 07:55 PM
  4. Compare Date Columns In Excel And Pull The Latest Date
    By marentette010 in forum Excel Help
    Replies: 1
    Last Post: 07-31-2013, 11:56 PM
  5. Macro to clear data based on color fill
    By Howardc in forum Excel Help
    Replies: 7
    Last Post: 12-03-2012, 09:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •