+ Reply to Thread
Results 1 to 27 of 27

Insert Blank row for each duplicated DATE an populate value from the other sheet

  1. #1
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Insert Blank row for each duplicated DATE an populate value from the other sheet

    Hello
    I want inserting blank row for each duplicates date in SH sheet and sum for column C,D in TOTAL row after inserting and populate the value in column F in last cell in last row contains duplicate date from MM sheet after matching DATE based on column A . when brings the value from MM should be for the last row contains duplicate date (before TOTAL row) in last cell for last duplicated date for column F from MM sheet to SH sheet in last cell for last duplicated date in column F .

    so I put the result how should be in SH sheet . the macro should not insert TOTAL row repeatedly when every time run the macro , every time I will add new data in SH sheet and I will change date in MM sheet then will search the new date in SH enter and do the same thing .

    thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Maybe you could achieve it with Subtotals and a formula?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Hi
    but I wanted to keep the value brought from MM sheet when add new value for new date
    example for 15/06/2023 will brings 2000 but if I add 2500 for 17/06/203 then will keep 2000 for 15/06/2023 without delete it .
    thanks

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Macro code:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 02-21-2024 at 03:19 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    @kvsrinivasamurthy
    thanks , but there are two things :
    first , don't insert TOTAL row continuously . just search for duplicates dates don't contain TOTAL row then should insert .
    second , what about value? should brings from MM sheet when match duplicates dates with SH sheet in column F , did you see it in EXPECTED sheet?

  7. #7
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    @jindon
    thanks ,but I don't want inserting Total row for duplicates dates have already inserting , I wanted to keep the value brought from MM sheet when add new value for new date
    example for 15/06/2023 will brings 2000 but if I add 2500 for 17/06/203 then will keep 2000 for 15/06/2023 without delete it .

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Then I don't think I understand what you are asking.
    I want inserting blank row for each duplicates date in SH sheet and sum for column C,D in TOTAL row after inserting and populate the value in column F in last cell in last row contains duplicate date from MM sheet after matching DATE based on column A .

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    I did not notice the 2nd requirement of Column F. Now included.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    ok
    but still inserting TOTAL row repeatedly when run the macro every time , also if I change value and change date will clear all of values in column F for SH.
    so when add new value and new date then will keep previous value like this (see the MM sheet. EXPECTED sheet)
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Then I don't think I understand what you are asking.
    when you inserting TOTAL row from the first time is ok but when the run macro more than one time every time will add TOTAL row under TOTAL row for the same duplicate date have ever added. just one time it's enough to add TOTAL row for each duplicates DATE .
    the idea just search for duplicate date doesn't contain TOTAL row then add , and each duplicate date contains TOTAL row then no need add TOTAL row again .as to the brought values from MM sheet ,please check file in post#10.
    you can see the problem about inserting TOTAL row every time,shouldn't do that.
    Attached Files Attached Files
    Last edited by Mussala; 02-21-2024 at 05:49 AM.

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    I don't know the reason why you need to run the code again...
    When you add data in mm sheet, col.F in sh sheet will be automatically updated from the last row of same date in mm sheet.

    Anyway.
    Please Login or Register  to view this content.
    Last edited by jindon; 02-21-2024 at 06:41 AM.

  13. #13
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Ref Post#10.
    After the first run you have only sh and mm sheets.

  14. #14
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    When you add data in mm sheet, col.F in sh sheet will be automatically updated from the last row of same date in mm sheet.
    I meant the previous value brought from MM sheet should keep it without delete previous value has ever added in SH sheet.
    this what I try to inform you in post#10 . you can note the 2000 value keep it when change duplicates date and change value . currently the code will delete previous value when change value for new date from column F . every time change date or value in MM sheet should keep the previous value for previous date in SH sheet without delete it as the code does it.

  15. #15
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Ref Post#10.
    After the first run you have only sh and mm sheets.
    I'm not sure what you try to say me!

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Code in post #12 has been updated.

  17. #17
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    awesome!
    this is exactly what I wanted ,jindon.
    thank you so much .

  18. #18
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    here are 2 macros.
    1) For inserting "TOTAL" rows in Ssh sheet
    Please Login or Register  to view this content.
    2) For up dating data from mm sheet to sh sheet. whenever you change data in mm sheet run this macro for updation.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    @kvsrinivasamurthy
    second macro doesn't brings the value at all, still inserting TOTAL row repeatedly when run the macro every time based on first macro .
    anyway thank you for come back for me.

  20. #20
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Hi jindon again
    I've found if I change the value for the same duplicates date doesn't change in SH sheet
    example :if I added 2000 to date 15/06/2023 in MM sheet then will sow in SH , but if I change value for the same date like this 2200 to date 15/06/2023 then should change the value from 2000 to 2200 .
    is there any way to fix it,please?

  21. #21
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    You need to explain how you are adding new dates in mm sheet.

    Are you replacing old data with new data?
    If so, what you are asking is IMPOSSIBLE.

  22. #22
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    ref post #19
    You have run 1st macro only once. once the "TOTAL" rows are inserted don't run that macro.
    For updating mm sheet run only update macro.
    Code modified.
    Please Login or Register  to view this content.

  23. #23
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Are you replacing old data with new data?
    for just the value for the same duplicates DATES
    when change to different value in MM sheet for duplicates date has ever added before in SH sheet then just replace with new value for the same duplicate date has ever added before in SH sheet.
    still IMPOSSIBLE?

  24. #24
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    You have run 1st macro only once. once the "TOTAL" rows are inserted don't run that macro.
    but I will add new duplicates dates in SH sheet as I said
    every time I will add new data in SH sheet
    then I need run the macro every time to insert TOTAL row for new duplicate date doesn't contain TOTAL row!

  25. #25
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    ok jindon see what I try to say you
    before file and highlighted red for cell F22 in SH sheet after file
    Attached Files Attached Files

  26. #26
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    Not really clear though.
    1) to a standard code module
    Please Login or Register  to view this content.
    2) to sh sheet code module
    Please Login or Register  to view this content.

  27. #27
    Registered User
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    68

    Re: Insert Blank row for each duplicated DATE an populate value from the other sheet

    yes jindon .
    it's great !
    thank you so much again.

+ 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] insert TOTAL row for each items are duplicated from sheet to another
    By MKLAQ in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-16-2021, 12:49 PM
  2. [SOLVED] Populate cell based on date, if not date then blank
    By Lungfish in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-15-2017, 08:42 PM
  3. Duplicated Date from Sheet 1 to Sheet 2
    By gillian1986 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-16-2015, 01:53 PM
  4. [SOLVED] Need to find how many times items from a particular date are duplicated throughout sheet
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-29-2013, 06:16 PM
  5. Populate summary sheet (insert & index rows from info in columns on another sheet)
    By DerbysGal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2011, 01:54 PM
  6. Depending on odd or even, insert two blank rows and populate the locations
    By axl_oz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2010, 01:19 PM
  7. Insert date entered in sheet 1 to first available blank row in sheet 3?
    By Drunken Clam in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-03-2008, 08:43 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