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: 67
Default VBA Sumproduct Help

I have a formula currently in cell G3 working fine, it goes out to another
file and returns a sumproduct:
=SUMPRODUCT(--('X:\unit 01\Equipment\[unit 1
Froster.xls]Roster'!$J$3:$J$300="x"),--(MONTH('X:\unit 01\Equipment\[unit 1
Froster.xls]Roster'!$P$3:$P$300)=1),--(YEAR('X:\unit 01\Equipment\[unit 1
FRoster.xls]Roster'!$P$3:$P$300)=$F$2))
There are perhpas 35 other similar formulas in other cells.

What I am trying to do is write some VBA so that when the program is run it
calculates the sumproduct. But I am struggling with the syntax to get the
formula in. This does not work of course:
Range("G" & (topRow + cTab)).Formula = "=SUMPRODUCT(--('X:\unit
01\Equipment\[unit 1 Froster.xls]Roster'!$J$3:$J$300="x"),--(MONTH('X:\unit
01\Equipment\[unit 1 Froster.xls]Roster'!$P$3:$P$300)=1),--(YEAR('X:\unit
01\Equipment\[unit 1 FRoster.xls]Roster'!$P$3:$P$300)=$F$2))"

Then to make matter harder I want to use variables for the filename. I have
defined eslewhere the path and filenames.

I am really struggling with the proper syntax converting double quotes to
single quotes etc. Anty assistance is appreciated.
 
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
SUMPRODUCT MIK Excel Worksheet Functions 3 March 15th 09 10:41 PM
Conditional SUMPRODUCT or SUMPRODUCT with Filters Ted M H Excel Worksheet Functions 4 August 14th 08 07:50 PM
sumproduct? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
Help with SUMPRODUCT? Gazzr Excel Worksheet Functions 4 June 30th 06 02:16 AM


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