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

Okay, so Sumproduct is not my forte.
I rarely use it.

I have this formula on a worksheet:

=SUMPRODUCT((L5:L1000="Boston Garden {2}")*(S5:S1000))

How can I convert this to VBA??

Thanks,
John


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Sumproduct VBA Conversion

you could loop through the cells or just let excel help your code:

MsgBox _
Application.Evaluate("SUMPRODUCT((L5:L1000=""Bosto n Garden {2}"")*(S5:S1000))")

(kind of feels like cheating, though.)

John Wilson wrote:

Okay, so Sumproduct is not my forte.
I rarely use it.

I have this formula on a worksheet:

=SUMPRODUCT((L5:L1000="Boston Garden {2}")*(S5:S1000))

How can I convert this to VBA??

Thanks,
John


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Sumproduct VBA Conversion

John

Try

MsgBox Evaluate("=sumproduct((L5:L1000=""Boston Garden {2}"")*(S5:S1000))")

Tony

----- John Wilson wrote: -----

Okay, so Sumproduct is not my forte.
I rarely use it.

I have this formula on a worksheet:

=SUMPRODUCT((L5:L1000="Boston Garden {2}")*(S5:S1000))

How can I convert this to VBA??

Thanks,
John



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Sumproduct VBA Conversion

Dave,

When I looked at your reply, my first thought was "I already tried
that 100 times in 100 different variations and I know it won't work!!!"

But I copied and pasted your conversion in the immediate window
just to prove my point and I'll be damned if it didn't give me exactly
the result that I was looking for. How could that be?!?!?!?!

I'm sure this won't be the last time that those double quotes will give
me an Excedrin headache.

Thanks a million,
John

"Dave Peterson" wrote in message
...
you could loop through the cells or just let excel help your code:

MsgBox _
Application.Evaluate("SUMPRODUCT((L5:L1000=""Bosto n Garden

{2}"")*(S5:S1000))")

(kind of feels like cheating, though.)

John Wilson wrote:

Okay, so Sumproduct is not my forte.
I rarely use it.

I have this formula on a worksheet:

=SUMPRODUCT((L5:L1000="Boston Garden {2}")*(S5:S1000))

How can I convert this to VBA??

Thanks,
John


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Sumproduct VBA Conversion

Tony,

Thanks.
Already rec'd the same answer from Dave.
I neglected to notice those quote marks when I was trying to convert this.

John

"acw" wrote in message
...
John

Try

MsgBox Evaluate("=sumproduct((L5:L1000=""Boston Garden

{2}"")*(S5:S1000))")

Tony

----- John Wilson wrote: -----

Okay, so Sumproduct is not my forte.
I rarely use it.

I have this formula on a worksheet:

=SUMPRODUCT((L5:L1000="Boston Garden {2}")*(S5:S1000))

How can I convert this to VBA??

Thanks,
John







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Sumproduct VBA Conversion

When it gets really confusing, I'll use: chr(34) instead of """" (is that
enough of them???)

John Wilson wrote:

Dave,

When I looked at your reply, my first thought was "I already tried
that 100 times in 100 different variations and I know it won't work!!!"

But I copied and pasted your conversion in the immediate window
just to prove my point and I'll be damned if it didn't give me exactly
the result that I was looking for. How could that be?!?!?!?!

I'm sure this won't be the last time that those double quotes will give
me an Excedrin headache.

Thanks a million,
John

"Dave Peterson" wrote in message
...
you could loop through the cells or just let excel help your code:

MsgBox _
Application.Evaluate("SUMPRODUCT((L5:L1000=""Bosto n Garden

{2}"")*(S5:S1000))")

(kind of feels like cheating, though.)

John Wilson wrote:

Okay, so Sumproduct is not my forte.
I rarely use it.

I have this formula on a worksheet:

=SUMPRODUCT((L5:L1000="Boston Garden {2}")*(S5:S1000))

How can I convert this to VBA??

Thanks,
John


--

Dave Peterson


--

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
Sumproduct with Condition OR Sumproduct with ADDRESS function - HE gholly Excel Discussion (Misc queries) 2 September 28th 09 05:07 PM
Conditional SUMPRODUCT or SUMPRODUCT with Filters Ted M H Excel Worksheet Functions 4 August 14th 08 07:50 PM
Month Conversion in SUMPRODUCT Cheese_whiz Excel Worksheet Functions 10 March 4th 08 06:37 PM
Day Conversion Michael Excel Worksheet Functions 3 September 10th 07 11:40 PM
ESN conversion jay-rod Excel Worksheet Functions 2 April 29th 07 11:36 PM


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