Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default inserting formulae

I am a novice in programming excel. I am trying to insert formula
through macro in a cell by using Formulaarray. I am encountering a
peculiar problem.

Formula i want to insert is

=-IF(UPPER($EC$14)="Y",AH22*AI22,AN22)*R22*SUMIF(PAY MENT_INDEX,"="
&F22,RNG_OPT_PREM)/COUNTIF(PAYMENT_INDEX,&F22)

Now if i want to insert it in A1 say,

i would write

A1.formulaArray =
"=-IF(UPPER($EC$14)="Y",AH22*AI22,AN22)*R22*SUMIF(PAY MENT_INDEX,"="
&F22,RNG_OPT_PREM)/COUNTIF(PAYMENT_INDEX,&F22)"

But VBA recognizes the starting inverted commas of the "Y" as the end
of formula and gives me syntax error.
How do i overcome this?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default inserting formulae

Hi,

double the quotes, like this:
"=-IF(UPPER($EC$14)=""Y"",AH22*AI22,AN22)*R22*SUMIF(P AYMENT_INDEX,""=""&F22,RNG_OPT_PREM)/COUNTIF(PAYMENT_INDEX,&F22)"

Regards,
Ivan

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
Auto fill formulae when inserting rows Riker1074 Excel Discussion (Misc queries) 9 December 30th 08 03:56 PM
Inserting new row but keeping formulae Alex Simpson Excel Worksheet Functions 0 August 8th 06 01:16 PM
inserting formulae [email protected] Excel Programming 2 May 9th 06 02:41 PM
inserting formulae [email protected] Excel Worksheet Functions 2 May 9th 06 02:08 PM
Subtotals and inserting formulae jandro Excel Programming 4 July 26th 05 02:50 PM


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