Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Continued SumProduct Woes

I have posted variations of this question a few times. I still haven't got a
final answer and will re-post hoping this post will catch some new eyes.
Also, I might not be describing my problem adequately.

Here is my code:

Private Sub CommandButton1_Click()

Dim OutReach As String
Dim WS As Worksheet
Dim AgeRange As String
Dim Red As Range

Set WS = Worksheets("Sheet1")
OutReach = Worksheets("Sheet3").Range("A1").Value
Set Red = WS.Range("I1")
AgeRange = "B1:B10"


OutReach = WS.Evaluate("=SUMPRODUCT((" & AgeRange & "1)*(D1:F10=""" &
Red.Value & """))")


End Sub

I want the varible "Outreach" (which is WS3:A10) to contain a text string of
address of a cell elsewhere in the file. I want the final answer of the
macro to arrive at the cell that is "addressed" in the "Outreach" variable.
Ultimately, I will have a looping macro which will keep changing that string
"addressed" in "Outreach" (WS3:A1). This way the answer can be looped into
multipe cell locations. This is just part of a bigger program but I need to
be able to get this part to work. Thanks in advance.

--
Thanks
Shawn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Continued SumProduct Woes

Private Sub CommandButton1_Click()

Dim OutReach As String
Dim WS As Worksheet
Dim AgeRange As String
Dim Red As Range

Set WS = Worksheets("Sheet1")
OutReach = Worksheets("Sheet3").Range("A1").Value
Set Red = WS.Range("I1")
AgeRange = "B1:B10"
On Error Resume Next
set rng = ws.Range(OutReach)
On Error goto 0
if rng is nothing then
msgbox "the variable OutReach (" & _
OutReach & ") does not contain " & _
" a valid cell address"
Exit sub
End if

rng = WS.Evaluate("=SUMPRODUCT((" & AgeRange & _
"1)*(D1:F10=""" & Red.Value & """))")


End Sub


--
Regards,
Tom Ogilvy


"Shawn" wrote in message
...
I have posted variations of this question a few times. I still haven't

got a
final answer and will re-post hoping this post will catch some new eyes.
Also, I might not be describing my problem adequately.

Here is my code:

Private Sub CommandButton1_Click()

Dim OutReach As String
Dim WS As Worksheet
Dim AgeRange As String
Dim Red As Range

Set WS = Worksheets("Sheet1")
OutReach = Worksheets("Sheet3").Range("A1").Value
Set Red = WS.Range("I1")
AgeRange = "B1:B10"


OutReach = WS.Evaluate("=SUMPRODUCT((" & AgeRange & "1)*(D1:F10=""" &
Red.Value & """))")


End Sub

I want the varible "Outreach" (which is WS3:A10) to contain a text string

of
address of a cell elsewhere in the file. I want the final answer of the
macro to arrive at the cell that is "addressed" in the "Outreach"

variable.
Ultimately, I will have a looping macro which will keep changing that

string
"addressed" in "Outreach" (WS3:A1). This way the answer can be looped

into
multipe cell locations. This is just part of a bigger program but I need

to
be able to get this part to work. Thanks in advance.

--
Thanks
Shawn



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
Uh-oh: NG propagation woes again? Joe User[_2_] Excel Discussion (Misc queries) 0 February 8th 10 08:29 PM
VERY new user with CSV woes phoenixxinOz New Users to Excel 3 November 26th 08 08:19 PM
For Each Next woes AZ Analog Excel Programming 4 May 23rd 05 08:53 PM
References woes WillRn Excel Programming 5 March 30th 05 10:41 PM
COUNTIF woes Thermometer Excel Worksheet Functions 6 March 28th 05 02:57 PM


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