Results 1 to 5 of 5

Macro to Clear Rows Where Total In Col D sums to Zero

Threaded View

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

    Macro to Clear Rows Where Total In Col D sums to Zero

    i have a macro to clear all data from row 2 in the sum of the values in Col D sums to zero


     Sub Deletevalues_SummingtoZero()
    
     Dim LR As Long, i As Long
    LR = Cells(Rows.Count, 1).End(xlUp).Row
    For i = LR To 2 Step -1
    If Application.Sum(Cells(LR, 4)) = 0 Then
    Rows(LR).clearcontents
    End If
    Next
    End Sub

    when running the macro the data is not being cleared even though the total values sums to zero


    It would be appreciated if someone could kindly amend my code

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to clear row containing Total and sum Col B and Col C
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-07-2019, 01:36 AM
  2. [SOLVED] Multiplying the results of two columns of sums - Total Billed and Total Paid
    By stuprice in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-02-2017, 04:23 PM
  3. Excel Macro that sums total employee hours.
    By norseman1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2016, 11:59 AM
  4. [SOLVED] Formula that Sums total for only rows that contain a certail value?
    By baumerr1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-09-2015, 03:24 PM
  5. [SOLVED] Macro to Create Total/Partial Sums
    By cckaesar in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-06-2015, 10:32 AM
  6. Creating a macro to insert a blank row and total sums in a new column
    By volleyballtigger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-23-2013, 10:42 AM
  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