Results 1 to 2 of 2

How to use a wildcard-containing SUMIF function in VBA?

Threaded View

  1. #1
    Registered User
    Join Date
    03-10-2015
    Location
    Nice, France
    MS-Off Ver
    Windows 8
    Posts
    2

    How to use a wildcard-containing SUMIF function in VBA?

    I would like to put the following functions in the cells of a given column if someone clicks on the button of a userform:

    =IF(A3<>"";SUMIF(Items!$A:$A;"*"&Summary!$A:$A&"*";Items!$E:$E);"")

    Should I go for an If and Then structure or create a user defined function?

    And how could I express that (especially the wildcard part)?

    'add gross value
    Dim j As Integer
    Dim Count As Double
    Dim Item As Object
    
    Count = WorksheetFunction.CountA(Sheets("Items"), Range("E:E"))
    
    For j = 3 To Count
      For Each Item In Sheets("Summary").Cells(j, 1)
           If Sheets("Summary").Cells(j, 1) = Sheets("Items").Cells(j, 1) Then
           'besoin de définir la fonction somme
           Sum Sheets("Items").Cells(j, 5)
           
           End If
       Next
       
     Next
    
    End Sub
    Last edited by manufr06; 03-10-2015 at 02:31 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sumif for wildcard character
    By patam in forum Excel General
    Replies: 2
    Last Post: 01-09-2007, 10:05 AM
  2. Replies: 5
    Last Post: 07-19-2006, 12:22 PM
  3. [SOLVED] Wildcard with sumif
    By fractallinda in forum Excel General
    Replies: 8
    Last Post: 02-27-2006, 07:15 PM
  4. Sumif using wildcard
    By claireanddoug in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2005, 06:05 PM
  5. SUMIF, wildcard and cell ref
    By Dave in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2005, 05:06 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