Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sumproduct operation in VBA array

Greetings and TIA for your time
I have a worksheet crosstab to sumarise a worksheet database by using
Sumproduct formulas. As an exercise, I would like to confine the calculations
to memory and finish by transfering the pre-calculated array to a range on
the worksheet...

Im trying the following approach:
From the database, load fields "Title" and "Country" into TitleArray and
CountryArray (into memory)
From the Crosstab row and column headers, load TitleHeaderArray and
CountryHeaderArray into memory.

Next, calculate each cell of the CrosstabArray in memory:
For i = 1 to Range("CountryHeader").cells.count
For j = 1 to Range("TitleHeader").cells.count
CrosstabArray(i , j) = _
Worksheetfunction.sumproduct(Arg1, Arg2)
next
next

I'm strugling with Arg1 & 2. If Arg1 were on the worksheet it would be:
--(Title = $A3) where A3 is the intersection of the current row and the range
"TitleHeader". Similarly, on the worksheet version, Arg2 would be: --(Country
= B$2)

For the VBA version i've tried for Arg1: (TitleArray = TitleHeaderArray(i))
and similar for Arg2: (CountryArray = CountryHeaderArray(j))

Am I completly off track? please help

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
Help with an array and SUMPRODUCT xlcharlie Excel Worksheet Functions 3 February 9th 10 09:16 PM
Sumproduct array Jumbo Jock[_2_] Excel Worksheet Functions 6 April 8th 09 01:49 AM
Brush up Array Operation by example frtklau Excel Discussion (Misc queries) 0 April 18th 05 11:46 AM
Brush up Array Operation by example frtklau Excel Discussion (Misc queries) 0 April 16th 05 05:06 PM
Brush up Array Operation by example frtklau Excel Discussion (Misc queries) 3 April 16th 05 04:51 PM


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

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

About Us

"It's about Microsoft Excel"