We help IT Professionals succeed at work.
Get Started

Using VBA to create a Sales Summary

Wm Allen Smith
on
101 Views
Last Modified: 2016-03-02
Good Day,

I want to create a sales summary report with VBA.  Using a simple example, , say I have a table with 3 columns: Fruit, Sales, Year
FRUIT      sales      Yr
Apples      400.06      2005
Apples      560.61      2004
Apples      952.38      2005
Apples      271.07      2003
Banana      630.28      2004
Banana      120.96      2003
Pear      401.17      2005
Pear      354.66      2004

Using an input box, I want  to enter the name of the fruit that I am looking for, the year that I am looking for and then  have code then sum the sales for the fruit and the year. I have attached a sample file with code so far.

Thanks ! :)

Initially, the output can be in a message box( I can move it to a range in the worksheet later).  Please advise.
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 10 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE