+ Reply to Thread
Results 1 to 5 of 5

VBA to make Total base on condtion

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    VBA to make Total base on condtion

    Hi All friend,

    I wonder someone may be able to help me please,

    i need to make VBA that calculate Total (Sum) base on condition, that i have highlight the row that need to make total (Sum) the amount base on the condition
    when i click on button (Total) , is networking i don't know why
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VBA to make Total base on condtion

    I think that the best approach here would be a pivot Table and not VBA but its hard to say because I don't see clearly what the sheet does. I think another column with categories will solve the problem, Then those categories will be the Rows for the Pivot Table.

    As for the code Its making reference to a LsVisXLB.xla that's an Addin without it I cannot debug any further.

    But I highly thing a Pivot Table will solve all the issues.

    Thanks

  3. #3
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    Re: VBA to make Total base on condtion

    Pls help me to on vba bottom "total" it run when I cut out some code

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

    Re: VBA to make Total base on condtion

    Sub test()
        Dim x As String
        With Range("a16").CurrentRegion
            x = .Columns(3).Resize(.Rows.Count - 1).SpecialCells(4).Offset(, 1).Address(0, 0)
            .Rows(.Rows.Count).Cells(4).Resize(, .Columns.Count - 1).Formula = "=sum(" & x & ")"
        End With
    End Sub

  5. #5
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    Re: VBA to make Total base on condtion

    thank you jindon, wonderful

+ 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. Combine 2 vba code make one output from data base
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2013, 10:54 AM
  2. comparing to base and deducting points from a total
    By Jo-Anne in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-09-2013, 02:30 PM
  3. Replies: 3
    Last Post: 09-17-2012, 11:43 AM
  4. How to make a particular Excel data base???
    By defy in forum Excel General
    Replies: 0
    Last Post: 05-19-2009, 04:28 AM
  5. [SOLVED] Pivot Tables - Calc % using Sub-Total, not Grand Total as base
    By sandi in forum Excel General
    Replies: 1
    Last Post: 12-19-2005, 05:59 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