+ Reply to Thread
Results 1 to 3 of 3

VBA to create a dynamic array which sums sales to a specific client based on product

  1. #1
    Registered User
    Join Date
    12-04-2019
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Mac OS
    Posts
    1

    VBA to create a dynamic array which sums sales to a specific client based on product

    Hello,

    I am new to this forum and would be very grateful to any help i can get.

    I am trying to create a VBA Macro that outputs a summary based on a number of variables. The variables would be Client, Product, Month and Year.

    Currently i have managed to write a code which searches for these variables and gives me each unique record found that matches the criteria.

    My issue is, i would like to have my code output the sum of values for each unique Product (variable) which i assume can be done by creating and array and adding the values whenever the same product is found in my data. The unique products exceed 700 in number and each client would be using different products.

    I have attached a sample of the spreadsheet i am using with the current code that will produce only unique records and not sum by product. My actual spreadsheet contains data that exceed 10,000 rows and the products in question are over 700 unique records.

    Thank you in advance for any help. In the meantime i will still be searching for similar examples or solutions.
    Attached Files Attached Files
    Last edited by SrAlx; 12-04-2019 at 04:35 AM. Reason: attaching file

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,420

    Re: VBA to create a dynamic array which sums sales to a specific client based on product

    Hello SrAlx and Welcome to Excel Forum.
    Would you be open to receiving another type solution as in formulas or a pivot table?
    For your profile please put the year version of Excel that you are using as it may have an influence on the choice of functions that are used in writing a proposed solution.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: VBA to create a dynamic array which sums sales to a specific client based on product

    Hi,

    I agree with JeteMc that a Pivot Table is much easier than VBA code and might give you your answer. See the attached where I've done a PT for you.

    Pivot not VBA Sofia Client Analytics.xls
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. [SOLVED] Looking to create a dynamic commissions sheet based on agent and product
    By Tutsumi in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-30-2019, 07:09 PM
  2. Replies: 7
    Last Post: 12-23-2018, 05:32 AM
  3. How to create a personalised email based on specific client data
    By csmithbermuda in forum Outlook Formatting & Functions
    Replies: 3
    Last Post: 07-05-2018, 10:45 AM
  4. Replies: 8
    Last Post: 09-06-2017, 12:47 PM
  5. Replies: 5
    Last Post: 02-26-2017, 10:05 PM
  6. Help with Formula to Sum Product Sales based on Sales Channel and Product
    By Casehype in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-28-2015, 07:20 PM
  7. Show the total sales for each year for specific Product Name.
    By Marcomm in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-14-2012, 11:25 AM

Tags for this Thread

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