Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Expected expression error help

Can anyone figure out why this line of code creates the compile error
message "expected expression"? I am trying to put a formula array
into a cell.

Selection.FormulaArray = _
"=SUM(IF('Raw data'!R4C6:R" & MaxRowSource & "C6=RC2,IF('Raw data'!
R4C" & SourceDOWCol & ":R" & MaxRowSource & "C" & SourceDOWCol &
=""x"", _
"IF('Raw data'!R4C17:R" & MaxRowSource & "C17<R3C,IF('Raw data'!
R4C18:R" & MaxRowSource & "C18R3C,'Raw data'!R4C16:R" & MaxRowSource
& "C16)))))"

Thanks,
Chet
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Expected expression error help

Hi

It seems that you have to many quotation signs in the formula string.
This should do it:

Selection.FormulaArray = _
"=SUM(IF('Raw data'!R4C6:R" & MaxRowSource & "C6=RC2,IF('Raw
data'! R4C" _
& SourceDOWCol & ":R" & MaxRowSource & "C" & SourceDOWCol & _
"=""x"", IF('Raw data'!R4C17:R" & MaxRowSource & _
"C17<R3C,IF('Raw data'! R4C18:R" & MaxRowSource & _
"C18R3C,'Raw data'!R4C16:R" & MaxRowSource & "C16)))))"

Regards,
Per

On 27 Mar., 21:19, Chet wrote:
Can anyone figure out why this line of code creates the compile error
message "expected expression"? *I am trying to put a formula array
into a cell.

Selection.FormulaArray = _
"=SUM(IF('Raw data'!R4C6:R" & MaxRowSource & "C6=RC2,IF('Raw data'!
R4C" & SourceDOWCol & ":R" & MaxRowSource & "C" & SourceDOWCol &
=""x"", _
"IF('Raw data'!R4C17:R" & MaxRowSource & "C17<R3C,IF('Raw data'!
R4C18:R" & MaxRowSource & "C18R3C,'Raw data'!R4C16:R" & MaxRowSource
& "C16)))))"

Thanks,
Chet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Expected expression error help

On Mar 27, 1:31*pm, Per Jessen wrote:
Hi

It seems that you have to many quotation signs in the formula string.
This should do it:

Selection.FormulaArray = _
* * "=SUM(IF('Raw data'!R4C6:R" & MaxRowSource & "C6=RC2,IF('Raw
data'! R4C" _
* * & SourceDOWCol & ":R" & MaxRowSource & "C" & SourceDOWCol & _
* * "=""x"", IF('Raw data'!R4C17:R" & MaxRowSource & _
* * "C17<R3C,IF('Raw data'! R4C18:R" & MaxRowSource & _
* * "C18R3C,'Raw data'!R4C16:R" & MaxRowSource & "C16)))))"

Regards,
Per

On 27 Mar., 21:19, Chet wrote:



Can anyone figure out why this line of code creates the compile error
message "expected expression"? *I am trying to put a formula array
into a cell.


Selection.FormulaArray = _
"=SUM(IF('Raw data'!R4C6:R" & MaxRowSource & "C6=RC2,IF('Raw data'!
R4C" & SourceDOWCol & ":R" & MaxRowSource & "C" & SourceDOWCol &
=""x"", _
"IF('Raw data'!R4C17:R" & MaxRowSource & "C17<R3C,IF('Raw data'!
R4C18:R" & MaxRowSource & "C18R3C,'Raw data'!R4C16:R" & MaxRowSource
& "C16)))))"


Thanks,
Chet- Hide quoted text -


- Show quoted text -


Thank you.. that worked splendidly! Chet
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
VBA Expected end of statement ERROR Paul Lambson Excel Programming 3 November 18th 08 09:58 PM
Expected end of statement error Patrick C. Simonds Excel Programming 1 August 14th 08 08:28 PM
concatenate expression error philr Excel Worksheet Functions 2 July 26th 07 04:18 PM
compile error: Expected: = ...Why? cesw[_2_] Excel Programming 3 September 10th 05 12:41 AM
Expected:expression Capinvest Excel Programming 3 August 4th 03 02:36 PM


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