Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Looping through and array with three possible decisions to make

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!




  #2   Report Post  
Posted to microsoft.public.excel.programming
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!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Looping through and array with three possible decisions to mak

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...

"Gary''s Student" wrote:

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!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex decisions, maybe? Noob McKnownowt Excel Worksheet Functions 8 November 16th 08 04:56 PM
looping through an array of ranges Arnold Klapheck Excel Programming 1 September 28th 06 06:46 PM
Looping data out of array gti_jobert[_8_] Excel Programming 0 February 3rd 06 10:09 AM
Simple Array Looping Nikky Excel Programming 2 April 20th 05 10:38 PM
Array / Looping Question Matt W[_2_] Excel Programming 7 April 10th 05 07:52 PM


All times are GMT +1. The time now is 06:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"