+ Reply to Thread
Results 1 to 13 of 13

Macro that can delete rows where duplicates found and replace with average value(vs2)

  1. #1
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Macro that can delete rows where duplicates found and replace with average value(vs2)

    jindon, could you create a similar macro to the "all in one" macro from yesterday with the scenarios
    below. I have attached the file to modify.

    Thanks Again for your assistance.

    Scenario #1
    MUWTF
    MUWTF =H16+H15

    Scenario #2
    MUWTF
    MUWTF
    RRF
    RRMH =(4*H69+H68)/5+H67+H66

    Scenario #3
    MUWTF
    RRF
    RRMH =(4*H64+H63)/5+H62
    Attached Files Attached Files

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

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    See if this calculation is correct for the first step.
    Please Login or Register  to view this content.
    Last edited by jindon; 09-15-2018 at 03:32 AM.

  3. #3
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    All calculations are correct except scenario #2 above. I have also pasted scenario #2 below and attached the results from the macro. Incorrect calculation is highlighted in yellow.

    Scenario #2
    MUWTF
    MUWTF
    RRF
    RRMH =(4*H69+H68)/5+H67+H66

    Thanks for your assistance.
    Attached Files Attached Files

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

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Always better to check before delete.
    Try
    Please Login or Register  to view this content.
    Last edited by jindon; 09-17-2018 at 08:35 AM.

  5. #5
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Scenario #2 is still not working for some reason

    See highlighted rows 593, 1180, 1253, 1256 in the attachment.

    Thanks
    Attached Files Attached Files

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

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Then the first code should be working correctly.

  7. #7
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Yes, the code below is perfect now. Can you now add the delete and replace the values in column H with the values in column N?

    Thanks jindon for all your help with this!!

    Please Login or Register  to view this content.
    Last edited by vbronton; 09-17-2018 at 09:43 AM.

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

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    ....................
    Last edited by jindon; 09-17-2018 at 10:04 AM.

  9. #9
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Thanks jindon.

    I have added the
    Please Login or Register  to view this content.
    tags around my code.

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

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Try this one.
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Yes, looks great! Now can we replace values in column H with values in column N

    Thanks again!

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

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Ahh,
    Just replace 3 "n"s with "h".

  13. #13
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Macro that can delete rows where duplicates found and replace with average value(vs2)

    Excellent! Thanks!

+ 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] Macro that can delete rows where duplicates found and replace with average value
    By vbronton in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-13-2018, 01:29 PM
  2. Found?, then delete entire rows. Not found end sub
    By Andrewstupendo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2018, 01:56 PM
  3. Replies: 7
    Last Post: 03-13-2015, 05:34 PM
  4. Macro To Find Rows With Duplicates, Compare Cells, And Delete Rows. - Excel
    By Kwame001 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2013, 10:41 AM
  5. Macro to delete multiple rows below that that is found
    By andy.k in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2013, 07:45 PM
  6. Macro to delete rows once #N/A is found in a cell
    By sn79 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-04-2013, 05:04 PM
  7. Replies: 13
    Last Post: 08-23-2011, 11:00 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