Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Calculate the result of an array in vba

For Each c In Range("A2", Range("A2").End(xlDown))
I would like vba to enter the result of the following array formula into
column P in each row:

{=SUM((A$2:A$1000=A2)*(F$2:F$1000=F2)*G$2:G$1000)}

I would like to do this without actually entering the formula -- only the
value.

Any help would be appreciated.

Thanks,

Sam


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Calculate the result of an array in vba

I'd add the formulas and then convert them to values.

If you blink, you may not even notice the formulas!

Option Explicit
Sub testme()

Dim myRng As Range
With ActiveSheet
Set myRng = .Range("p2:p" & .Range("a2").End(xlDown).Row)
End With

With myRng
.Formula = "=SUMproduct((A$2:A$1000=A2)*(F$2:F$1000=F2)*G$2:G $1000)"
.Value = .Value
End With
End Sub



Sam wrote:

For Each c In Range("A2", Range("A2").End(xlDown))
I would like vba to enter the result of the following array formula into
column P in each row:

{=SUM((A$2:A$1000=A2)*(F$2:F$1000=F2)*G$2:G$1000)}

I would like to do this without actually entering the formula -- only the
value.

Any help would be appreciated.

Thanks,

Sam


--

Dave Peterson
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 excel array - select, add and calculate result [email protected] Excel Worksheet Functions 0 July 12th 07 06:51 PM
Calculate time, but if less then hrs, end result must be 1 hrs Shariq New Users to Excel 1 December 21st 06 01:53 PM
Query on how I would calculate a result in Excel? confused Excel Worksheet Functions 3 December 6th 06 11:10 AM
find each of the items in an array and save result in another array lif[_5_] Excel Programming 2 June 28th 06 01:54 AM
compare two columns, then calculate a result dazp1970 Excel Discussion (Misc queries) 9 December 11th 05 02:35 PM


All times are GMT +1. The time now is 09:22 AM.

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"