Looping through and array with three possible decisions to make

  • Thread starter Thread starter jayklmno
  • Start date Start date
J

jayklmno

I am probably making this more complex than I need to, so what is the
simplest way to loop through an array, looking for possibly three common bits
of data and adding them together. Using a wine example... I am searching a
series of 800+ records for:

Wine Vendor
Wine Origin
Wine Category

The user would choose from a drop down, either vendor, origin or category,
and the macro calcs sales and costs based on the selections. For any of the
three, the user can choose "ALL" or a specific value in each group.

I started writing sub routines to take into account each possible option,
but hoped there might be an easier way... can anyone help with a shorter
solution?

Thanks!
 
You can do this completely without programming. Say you have four columns:
Col A - Vendor
Col B - Origin
Col C - Catagory
Col D - Sales

Select a column header and:

Data > Filter > AutoFilter

You can then select combinations of options. Use the =SUBTOTAL() function
to add up sales because SUBTOTAL() only sums the visible part of filtered
data.
 
Unfortunately, I have been asked not to go that route for fear of confusing
individuals with too much information. I need to perform work on the data and
just present the answer. I would have had it done with autofilters...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top