Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Helpme with Forumal Array option

I get the following error while trying to run the Macro, I just started
learing.

"Unable to set the formulaArray Property of the Range class - Error"

Selection.FormulaArray = "=SUM(IF('Email Raw
Data'!R1C1:R900C1=RC[-2],IF('Email Raw Data'!R1C11:R900C11=""Service Desk
Queue"",1,0),0))+SUM(IF('Email Raw Data'!R1C1:R900C1=RC[-2],IF('Email Raw
Data'!R1C11:R900C11=""(None)"",1,0),0))+SUM(IF('Em ail Raw
Data'!R1C1:R900C1=RC[-2],IF('Email Raw Data'!R1C11:R900C11=""Miscellaneous
Queue"",1,0),0))"

Thanks for you Help
  #2   Report Post  
Posted to microsoft.public.excel.programming
r r is offline
external usenet poster
 
Posts: 125
Default Helpme with Forumal Array option

RC[-2]
This is not like
regards
r


Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"Adhikarun" wrote:

I get the following error while trying to run the Macro, I just started
learing.

"Unable to set the formulaArray Property of the Range class - Error"

Selection.FormulaArray = "=SUM(IF('Email Raw
Data'!R1C1:R900C1=RC[-2],IF('Email Raw Data'!R1C11:R900C11=""Service Desk
Queue"",1,0),0))+SUM(IF('Email Raw Data'!R1C1:R900C1=RC[-2],IF('Email Raw
Data'!R1C11:R900C11=""(None)"",1,0),0))+SUM(IF('Em ail Raw
Data'!R1C1:R900C1=RC[-2],IF('Email Raw Data'!R1C11:R900C11=""Miscellaneous
Queue"",1,0),0))"

Thanks for you Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Helpme with Forumal Array option

You have too many characters in your formula.

The maximum length the formula can be to programmatically add it to a range,
at least using FormulaArray, is 255.

Figure out a way to trim the formula down.

Here is a sample macro that demonstrates

Sub FormulaArrayMaxTester()

' Construct a formula with 255 characters exactly
Dim s As String
s = "=SUM(IF(R13C7:R32C7=""a"",R13C8:R32C8))"
s = s &
"+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+ 1+1+1+1+1+1+1+1"
s = s &
"+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+ 1+1+1+1+1+1+1+1"
s = s & "+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+ 1+1+1+1+1"
s = s & "+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1"

' FormulaArray max characters allowed is 255...
Debug.Print Len(s)

'...so this works
Range("A1").FormulaArray = s

'.. but if I add one more character, error
s = s & "1"
Range("A1").Offset(1).FormulaArray = s

End Sub

--
Regards,
Tim Zych
http://www.higherdata.com
Workbook Compare - Excel data comparison utility

"Adhikarun" wrote in message
...
I get the following error while trying to run the Macro, I just started
learing.

"Unable to set the formulaArray Property of the Range class - Error"

Selection.FormulaArray = "=SUM(IF('Email Raw
Data'!R1C1:R900C1=RC[-2],IF('Email Raw Data'!R1C11:R900C11=""Service Desk
Queue"",1,0),0))+SUM(IF('Email Raw Data'!R1C1:R900C1=RC[-2],IF('Email Raw
Data'!R1C11:R900C11=""(None)"",1,0),0))+SUM(IF('Em ail Raw
Data'!R1C1:R900C1=RC[-2],IF('Email Raw Data'!R1C11:R900C11=""Miscellaneous
Queue"",1,0),0))"

Thanks for you Help



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Helpme with Forumal Array option

You have too many characters in your formula.

The maximum length the formula can be to programmatically add it to a range,
at least using FormulaArray, is 255.

Figure out a way to trim the formula down.

Here is a sample macro that demonstrates

Sub FormulaArrayMaxTester()

' Construct a formula with 255 characters exactly
Dim s As String
s = "=SUM(IF(R13C7:R32C7=""a"",R13C8:R32C8))"
s = s &
"+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+ 1+1+1+1+1+1+1+1"
s = s &
"+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+ 1+1+1+1+1+1+1+1"
s = s & "+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+ 1+1+1+1+1"
s = s & "+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1"

' FormulaArray max characters allowed is 255...
Debug.Print Len(s)

'...so this works
Range("A1").FormulaArray = s

'.. but if I add one more character, error
s = s & "1"
Range("A1").Offset(1).FormulaArray = s

End Sub

--
Regards,
Tim Zych
http://www.higherdata.com
Workbook Compare - Excel data comparison utility

"Adhikarun" wrote in message
...
I get the following error while trying to run the Macro, I just started
learing.

"Unable to set the formulaArray Property of the Range class - Error"

Selection.FormulaArray = "=SUM(IF('Email Raw
Data'!R1C1:R900C1=RC[-2],IF('Email Raw Data'!R1C11:R900C11=""Service Desk
Queue"",1,0),0))+SUM(IF('Email Raw Data'!R1C1:R900C1=RC[-2],IF('Email Raw
Data'!R1C11:R900C11=""(None)"",1,0),0))+SUM(IF('Em ail Raw
Data'!R1C1:R900C1=RC[-2],IF('Email Raw Data'!R1C11:R900C11=""Miscellaneous
Queue"",1,0),0))"

Thanks for you Help



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
If Then forumal DJ Excel Worksheet Functions 7 July 3rd 08 02:33 AM
Worksheet forumal help James@ Setting up and Configuration of Excel 1 December 1st 06 01:25 AM
Seeking Help with a forumal. [email protected] Excel Programming 2 April 7th 06 10:39 PM
Having problem with subtotal helpme out ramse[_3_] Excel Programming 2 February 15th 06 07:09 PM
forumal does not work Excel Worksheet Functions 0 November 11th 05 02:10 AM


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