Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Brett
 
Posts: n/a
Default Please Help!! Macro error

I'm trying to run a macro with the following formula in it:

Range("M2").Select
Selection.FormulaArray = _

"=IF(ISERROR(INDEX(R!A2:R5000,MATCH(LARGE(IF(R!A2: T5000=A2,R!Q2:Q5000),1),R!Q2:Q5000,0),14))=FALSE,I NDEX(R!A2:T5000,MATCH(LARGE(IF(R!A2:T5000=A2,R!Q2: Q5000),1),R!Q2:Q5000,0),14),0)"


Everytime I run it, I get the "Unable to set the formulaArray property of
the range class " error". I thought I might have exceeded the 255 limit, but
the formula is only 181 characters!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Please Help!! Macro error

If you read help, you will see that FormulaArray needs R1C1 notation, not A1


Range("M2").FormulaArray = _
"=IF(ISERROR(INDEX(R!R2C1:R5000C18,MATCH(LARGE(IF( R!R2C1:R5000C20=R2C1,R!R2C
17:R5000C17),1),R!R2C17:R5000C17,0),14))=FALSE,IND EX(R!R2C1:R5000C20,MATCH(L
ARGE(IF(R!R2C1:R5000C20=R2C1,R!R2C17:R5000C17),1), R!R2C17:R5000C17,0),14),0)
"

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Brett" wrote in message
...
I'm trying to run a macro with the following formula in it:

Range("M2").Select
Selection.FormulaArray = _


"=IF(ISERROR(INDEX(R!A2:R5000,MATCH(LARGE(IF(R!A2: T5000=A2,R!Q2:Q5000),1),R!
Q2:Q5000,0),14))=FALSE,INDEX(R!A2:T5000,MATCH(LARG E(IF(R!A2:T5000=A2,R!Q2:Q5
000),1),R!Q2:Q5000,0),14),0)"


Everytime I run it, I get the "Unable to set the formulaArray property of
the range class " error". I thought I might have exceeded the 255 limit,

but
the formula is only 181 characters!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default Please Help!! Macro error

Hi Brett,

The problem is, your formula is 316 (or so) characters in R1C1 Reference
Style, which is what Excel uses internally and which counts for the maximum
of 256.

--
Kind regards,

Niek Otten

"Brett" wrote in message
...
I'm trying to run a macro with the following formula in it:

Range("M2").Select
Selection.FormulaArray = _

"=IF(ISERROR(INDEX(R!A2:R5000,MATCH(LARGE(IF(R!A2: T5000=A2,R!Q2:Q5000),1),R!Q2:Q5000,0),14))=FALSE,I NDEX(R!A2:T5000,MATCH(LARGE(IF(R!A2:T5000=A2,R!Q2: Q5000),1),R!Q2:Q5000,0),14),0)"


Everytime I run it, I get the "Unable to set the formulaArray property of
the range class " error". I thought I might have exceeded the 255 limit,
but
the formula is only 181 characters!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default Please Help!! Macro error

Try using named ranges instead.

--
Kind regards,

Niek Otten

"Brett" wrote in message
...
I'm trying to run a macro with the following formula in it:

Range("M2").Select
Selection.FormulaArray = _

"=IF(ISERROR(INDEX(R!A2:R5000,MATCH(LARGE(IF(R!A2: T5000=A2,R!Q2:Q5000),1),R!Q2:Q5000,0),14))=FALSE,I NDEX(R!A2:T5000,MATCH(LARGE(IF(R!A2:T5000=A2,R!Q2: Q5000),1),R!Q2:Q5000,0),14),0)"


Everytime I run it, I get the "Unable to set the formulaArray property of
the range class " error". I thought I might have exceeded the 255 limit,
but
the formula is only 181 characters!



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Please Help!! Macro error

The length of the formula is measured when in R1C1 reference style.

http://www.dicks-blog.com/archives/2...rmulas-in-vba/
(one line in your browser)

May have a workaround.

Brett wrote:

I'm trying to run a macro with the following formula in it:

Range("M2").Select
Selection.FormulaArray = _

"=IF(ISERROR(INDEX(R!A2:R5000,MATCH(LARGE(IF(R!A2: T5000=A2,R!Q2:Q5000),1),R!Q2:Q5000,0),14))=FALSE,I NDEX(R!A2:T5000,MATCH(LARGE(IF(R!A2:T5000=A2,R!Q2: Q5000),1),R!Q2:Q5000,0),14),0)"


Everytime I run it, I get the "Unable to set the formulaArray property of
the range class " error". I thought I might have exceeded the 255 limit, but
the formula is only 181 characters!


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Please Help!! Macro error

But that's the same reply you have in the other thread.

Brett wrote:

I'm trying to run a macro with the following formula in it:

Range("M2").Select
Selection.FormulaArray = _

"=IF(ISERROR(INDEX(R!A2:R5000,MATCH(LARGE(IF(R!A2: T5000=A2,R!Q2:Q5000),1),R!Q2:Q5000,0),14))=FALSE,I NDEX(R!A2:T5000,MATCH(LARGE(IF(R!A2:T5000=A2,R!Q2: Q5000),1),R!Q2:Q5000,0),14),0)"


Everytime I run it, I get the "Unable to set the formulaArray property of
the range class " error". I thought I might have exceeded the 255 limit, but
the formula is only 181 characters!


--

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
Macro Issue - Run time error 1004 Matt7102 Excel Discussion (Misc queries) 1 December 22nd 05 12:35 AM
MS Visual Basic Error...from MAcro G118 Excel Discussion (Misc queries) 0 December 12th 05 05:56 PM
Macro time out error mike b Excel Worksheet Functions 1 December 10th 05 05:21 PM
Macro / Compile Error / Duplicate Declaration carl Excel Worksheet Functions 1 June 29th 05 08:55 PM
Runtime error for macro that works in workbook created in Crystal Excel Discussion (Misc queries) 1 June 22nd 05 08:43 PM


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