PC Review


Reply
Thread Tools Rate Thread

Coding Formula

 
 
=?Utf-8?B?UmljaGFyZA==?=
Guest
Posts: n/a
 
      21st Sep 2007
I have a very complex formula as follows:

=IF(ISERR(FIND("COLLATERAL",BZ2))=FALSE,"Overige_Beleggingen",IF(AND(ISNA(VLOOKUP($H2,Vast_Table,2,FALSE))=FALSE,AB2<>"CASH"),VLOOKUP($H2,Vast_Table,2,FALSE),IF(OR(AB2="CASH",ISERR(FIND("COLLATERAL",BZ2))=FALSE,ISERR(FIND("ILF",BZ2))=FALSE),"Overige_Beleggingen","Aandelen")))

Which I would like to have entered into my spreadsheet using code. The
spreadsheet changes size ie no. of rows each time it is used so I want to
ensure that all necessary cell have the correct formula.

It would appear that due to it's complexity with quotes being used a number
of times within the nested functions, that I cannot simply use
Range("A2").Formula =

Could someone please advise on the best solution.

Many Thanks

Richard
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      21st Sep 2007

Try just using a double quote for each


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Richard" <(E-Mail Removed)> wrote in message
news:4C2378A6-96A0-4303-B5A6-(E-Mail Removed)...
>I have a very complex formula as follows:
>
> =IF(ISERR(FIND("COLLATERAL",BZ2))=FALSE,"Overige_Beleggingen",IF(AND(ISNA(VLOOKUP($H2,Vast_Table,2,FALSE))=FALSE,AB2<>"CASH"),VLOOKUP($H2,Vast_Table,2,FALSE),IF(OR(AB2="CASH",ISERR(FIND("COLLATERAL",BZ2))=FALSE,ISERR(FIND("ILF",BZ2))=FALSE),"Overige_Beleggingen","Aandelen")))
>
> Which I would like to have entered into my spreadsheet using code. The
> spreadsheet changes size ie no. of rows each time it is used so I want to
> ensure that all necessary cell have the correct formula.
>
> It would appear that due to it's complexity with quotes being used a
> number
> of times within the nested functions, that I cannot simply use
> Range("A2").Formula =
>
> Could someone please advise on the best solution.
>
> Many Thanks
>
> Richard


 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      21st Sep 2007
Hi,

To enter your formula into a cell using VBA try this:-

Sub servient()
Range("A1").Formula =
"=IF(ISERR(FIND(""COLLATERAL"",BZ2))=FALSE,""Overige_Beleggingen"",IF(AND(ISNA(VLOOKUP($H2,Vast_Table,2,FALSE))=FALSE,AB2<>""CASH""),VLOOKUP($H2,Vast_Table,2,FALSE),IF(OR(AB2=""CASH"",ISERR(FIND(""COLLATERAL"",BZ2))=FALSE,ISERR(FIND(""ILF"",BZ2))=FALSE),""Overige_Beleggingen"",""Aandelen"")))"
End Sub

You will need to provide more information on where and under what conditions
you want this formula filling other cells.

Mike

"Richard" wrote:

> I have a very complex formula as follows:
>
> =IF(ISERR(FIND("COLLATERAL",BZ2))=FALSE,"Overige_Beleggingen",IF(AND(ISNA(VLOOKUP($H2,Vast_Table,2,FALSE))=FALSE,AB2<>"CASH"),VLOOKUP($H2,Vast_Table,2,FALSE),IF(OR(AB2="CASH",ISERR(FIND("COLLATERAL",BZ2))=FALSE,ISERR(FIND("ILF",BZ2))=FALSE),"Overige_Beleggingen","Aandelen")))
>
> Which I would like to have entered into my spreadsheet using code. The
> spreadsheet changes size ie no. of rows each time it is used so I want to
> ensure that all necessary cell have the correct formula.
>
> It would appear that due to it's complexity with quotes being used a number
> of times within the nested functions, that I cannot simply use
> Range("A2").Formula =
>
> Could someone please advise on the best solution.
>
> Many Thanks
>
> Richard

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with formula in vb coding mc Microsoft Excel Programming 5 7th Jul 2009 01:17 PM
Need help coding, programming, formula njl Microsoft Access Form Coding 0 17th Jan 2007 03:43 PM
Help with Coding a Formula Please Paul Black Microsoft Excel Programming 7 18th Aug 2005 07:12 PM
Formula Color Coding =?Utf-8?B?QW5kcmV3?= Microsoft Excel Misc 5 25th Mar 2005 08:41 PM
vba coding for formula in cell =?Utf-8?B?UkRQMQ==?= Microsoft Excel Programming 2 7th Feb 2005 10:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:35 AM.