Results 1 to 2 of 2

VBA Filtering and summing problem

Threaded View

Palucci VBA Filtering and summing... 02-10-2022, 10:25 AM
Ochimus Re: VBA Filtering and summing... 02-11-2022, 03:57 PM
  1. #1
    Registered User
    Join Date
    09-17-2021
    Location
    Gdynia
    MS-Off Ver
    2016
    Posts
    66

    VBA Filtering and summing problem

    I have data that I put in sample.xlsx and the code that should filter the items "CIRS" and FX_FORWARDS from the INSTRUMENT column and sum the values from the NOMINAL_MAX column. However, in the indicated .Range it shows me the value 0
    With wbMe.Sheets("pochodne")
    If .AutoFilterMode Then .AutoFilterMode = False
        Nominal_MAX = "Nominal_MAX"
        CIRS = "INSTRUMENT"
        FX_FORWARD = "INSTRUMENT"
        LastRow = .Cells(Rows.Count, 1).End(xlUp).Row
        LastCol = .Cells(1, Columns.Count).End(xlToLeft).Column
        Set rTable = .Range(.Cells(1, 1), .Cells(LastRow, LastCol))
        Set rCol = rTable.Rows(1).Find(What:=Nominal_MAX, LookIn:=xlValues, LookAt:=xlWhole)
        Set rCol1 = rTable.Rows(1).Find(What:=CIRS, LookIn:=xlValues, LookAt:=xlWhole)
        Set rCol2 = rTable.Rows(1).Find(What:=FX_FORWARD, LookIn:=xlValues, LookAt:=xlWhole)
        If Not rCol Is Nothing Then
            .Range("T39").Value = Application.WorksheetFunction.Round(Application.WorksheetFunction.SumIfs(rTable.Columns(rCol.Column), rTable.Columns(rCol.Column), "<>0", rTable.Columns(rCol1.Column), "CIRS", rTable.Columns(rCol2.Column), "FX_FORWARD"), 0)
        Else
            SumCriteria = CVErr(xlErrValue)
        End If
    End With

    cross post : https://stackoverflow.com/questions/...-and-sum-issue
    Attached Files Attached Files
    Last edited by Palucci; 02-10-2022 at 11:28 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Filtering data after summing up in pivot table
    By paradise2sr in forum Excel General
    Replies: 6
    Last Post: 02-16-2015, 01:59 AM
  2. macro for filtering A column and summing up respective cells in B column
    By rajkumarmp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2013, 11:12 AM
  3. input box problem, cell filtering problem, result display while locking sheet
    By croozin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2013, 08:52 AM
  4. [SOLVED] Summing Filtering Problem
    By vchibisov in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2013, 02:06 PM
  5. Filtering and Summing up the data in excel sheet
    By bharadhwazgb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-15-2012, 08:57 PM
  6. An other summing problem
    By HJM in forum Excel General
    Replies: 0
    Last Post: 01-12-2012, 04:26 PM
  7. problem with summing
    By cs78 via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-14-2005, 05:05 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