LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default SUMPRODUCT Issue

I have the following code:

Private Sub CommandButton1_Click()

Dim OutReach As Range
Dim Age As String
Dim Color As String
Dim WS As Worksheet

Set WS = Worksheets("Sheet1")
Set OutReach = WS.Range("A15")
Age = "H1"
Color = "I1"


OutReach.Value = WS.Evaluate("=SUMPRODUCT((B1:B10=" & Age &
")*(D1:F10=" & Color & "))")

End Sub



The line: OutReach.Value = WS.Evaluate("=SUMPRODUCT((B1:B10=" & Age &
")*(D1:F10=" & Color & "))") searches range B1:B10 on Worksheet1 and
finds the values equal to the Age variable then multiples by a search of the
ragne D1:F10 of the values equal to the Color variable. All this stuff
happens on Sheet1.


I need to be able; however, to have the OutReach.Value to appear on Sheet2
and I need the Age and Color variable to refer to Sheet2.

How can I re-write my code to accomplish this?



 
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
SUMPRODUCT issue ISAF Media Analysis[_2_] Excel Discussion (Misc queries) 4 November 5th 09 02:43 PM
SUMPRODUCT Issue Stuck Excel Worksheet Functions 5 July 16th 09 01:18 AM
I believe this is a SUMPRODUCT issue WLMPilot Excel Worksheet Functions 2 August 14th 08 09:35 PM
Issue with sumproduct Steved Excel Worksheet Functions 8 July 18th 05 11:19 PM
SUMPRODUCT issue TonyL Excel Worksheet Functions 2 May 27th 05 12:46 AM


All times are GMT +1. The time now is 12:17 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"