+ Reply to Thread
Results 1 to 4 of 4

TRIM SUM - Row delete - Color Row based on Value

  1. #1
    Forum Contributor
    Join Date
    12-14-2005
    Location
    US
    MS-Off Ver
    Excel 2019, Excel 365, Excel Mobile (Android)
    Posts
    145

    TRIM SUM - Row delete - Color Row based on Value

    I've been using a worksheet that has a TRIM VBA function that works well. I copy and paste the data each month from another program into the DATA tab. Then, click on the TRIM macro button and the data is set out in the DATA2 worksheet. All has worked well until some recent changes to the input data that now requires an adjustment to the VBA code, which now requires some help.

    I have attached a sample workbook with data for reference and the VBA code used.

    Base on the data pasted in worksheet 1 [DATA], I need the VBA to:
    1. Remove all the SUBTOTAL rows
    2. Remove all the blank rows
    3. Complete the TRIM function with the changes into worksheet 2 [DATA2]
    4. Highlight the rows [Highlight color "Yellow"] where the accrual amount [Col I] is negative amount
    5. Sum the data amount in col I based on FUND col [A] reference #

    Their is one change needed in the summing VBA function in worksheet 2 [DATA2]. That is where the fund code equals 0160A1 and the ACC [Col D] starts with "SP". What is needed is for the a sum for 0160A1 and a sum for 0160A1 - SP.

    Hopefully, the existing code for the TRIM function and the sum just needs some minor adjustment.

    As always thank you for all help provided.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: TRIM SUM - Row delete - Color Row based on Value

    hi,

    i can help you with the vba
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
    If you have been helped, maybe you could click the *

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: TRIM SUM - Row delete - Color Row based on Value

    Is there any reason why you need sheet2...Why not just convert sheet1 automatically
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 03-04-2023 at 04:23 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    12-14-2005
    Location
    US
    MS-Off Ver
    Excel 2019, Excel 365, Excel Mobile (Android)
    Posts
    145

    Re: TRIM SUM - Row delete - Color Row based on Value

    Thanks for the help. All of the criteria in my post 1 through 5 have been met. The Subtotal rows have been removed, blank rows removed, TRIM function still works, the less than zero amounts are highlighted in yellow, and each fund reference number aggregates the amounts.

    However, the VBA code for the last criteria is still not written. When totaling the fund code 0160A1 [Col A] there needs to be 2 totals: 1 for 0160A1 where Col D does not have "SP" as part of the code and 1 for 0160A1 where Col D HAS "SP as part of the code. That is the last piece of the puzzle.

    Looking forward to finalizing this one. Thanks for all the help.

+ 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] Delete Rows based on Highlighted color
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-28-2017, 11:48 PM
  2. [SOLVED] delete worksheets based on color
    By xi603 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2017, 02:14 PM
  3. [SOLVED] Delete Row Based on Color
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-04-2014, 01:50 PM
  4. delete a row based on color of cell
    By karimretina in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2014, 05:18 AM
  5. [SOLVED] Delete row based on red color font
    By Jhon Mustofa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-02-2014, 10:02 AM
  6. Delete Columns Based On Fill Color
    By jlkirk in forum Excel General
    Replies: 7
    Last Post: 01-28-2013, 02:00 PM
  7. Delete Rows Based On Color
    By Tommyweather in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2008, 04:24 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