View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Looping through and array with three possible decisions to make

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.
--
Gary''s Student - gsnu200761


"jayklmno" wrote:

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!