+ Reply to Thread
Results 1 to 8 of 8

Macro to clear row containing Total and sum Col B and Col C

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,712

    Macro to clear row containing Total and sum Col B and Col C

    I have written code to first clear the last row where "Total" is in Col A as well as the values in the same row as "Total" in Col B & C

    I cannot get this to clear the last row where total is as well the values in the same row as "Total" in Col B & C


    Secondly I need to total Col B & C. My code is only totalling Col B

    See code below

    Please Login or Register  to view this content.

    It would be appreciated if someone can kindly assist me

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

    Re: Macro to clear row containing Total and sum Col B and Col C

    Hi Howardc1001

    Without your actual scenario one can only assume what you are trying to achieve...
    This is an correction of your code that would work, assuming that "Total" is in the last row, however, if you upload a sample file with your actual setup we could offer a better solution...
    Please Login or Register  to view this content.
    Last edited by sintek; 01-06-2019 at 01:15 PM.
    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!!!

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,712

    Re: Macro to clear row containing Total and sum Col B and Col C

    Thanks for the help.


    Every time I run the Macro, The total values move down by 3 rows. Every time I run the macro, I need the total row to first be cleared and then the data added 3 rows after the last row containing the data


    See sample data attached
    Attached Files Attached Files

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

    Re: Macro to clear row containing Total and sum Col B and Col C

    then the data added 3 rows after the last row containing the data
    What data gets added 3 rows after?

  5. #5
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,712

    Re: Macro to clear row containing Total and sum Col B and Col C

    The row containing Total Value moved down by 3 rows each time the macro runs

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

    Re: Macro to clear row containing Total and sum Col B and Col C

    I don't get it...Why not just insert 3 rows...

    Anyway, I assume your actual file will explain...No worries...

    This deletes final row total...Finds new final row and puts total 3 rows down???
    Still don't understand what you are trying to achieve...Perhaps someone else can grasp..
    Please Login or Register  to view this content.
    Last edited by sintek; 01-06-2019 at 02:08 PM.

  7. #7
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,712

    Re: Macro to clear row containing Total and sum Col B and Col C

    Hi Sintek

    I have resolved it


    See amended code below

    Please Login or Register  to view this content.

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

    Re: Macro to clear row containing Total and sum Col B and Col C

    Glad you got it sorted...please mark your thread as solved...

+ 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. Macro to solve total, subtotal and grand total automatically...
    By blorban in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2015, 05:25 PM
  2. [SOLVED] Macro to Total a Column Up 15 cells and place total in cell of last row
    By guitarsweety in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-20-2014, 05:25 PM
  3. [SOLVED] running total then clear cell?
    By royaldex in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-14-2014, 12:22 PM
  4. running total then clear cell?
    By royaldex in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-14-2014, 11:22 AM
  5. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  6. Need a macro to total different lines and move total to new cell
    By cmefix in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-09-2012, 02:08 PM
  7. Add to Total and Clear Macro
    By abcd12 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2008, 01:04 PM

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