Selection.Formula problem 
Author Message
 Selection.Formula problem

I have written a formula to repair a formatting problem on an imported
file.  My problem though, is when I put it in the VB editor I get a
Run-time error '1004'.

I have located the source of the problem but don't know how to fix.

Here is a simplified example of what happens:
Selection.Formula = "=IF(ISBLANK(A1),"",4)"

The problem is the "" in the middle of the formula.  Putting this
formula directly into the spreadsheet works but the "" make the run-time

error occur.

I need to get the blank cell returned as a blank cell.  How do I get
around this?
Thanx



Thu, 17 Aug 2000 03:00:00 GMT  
 Selection.Formula problem

Use double quotes for each quote you need to insert in your string

Selection.Formula +AD0- +ACIAPQ-IF(ISBLANK(A1),+ACIAIgAiACI-,4)+ACI-

or if you prefer

Selection.Formula +AD0- +ACIAPQ-IF(ISBLANK(A1),+ACI- +ACY- CHR+ACQ-(34) +ACY- CHR+ACQ-(34) +ACY- +ACI-,4)+ACI-

 ..... then .... are you sure ISBLANK is a Jet function ?

Bye



Sat, 19 Aug 2000 03:00:00 GMT  
 Selection.Formula problem

Alan,
     I am assuming you are referring to Crystal's .SelectionFormula
property.
     Replace the double-quotes within the formula with single-quotes.  In
other words:
     .SelectionFormula = "=IF(ISBLANK(A1),'',4)"

Good luck,
Bob
--
Bob Uyeda, Executive Vice President
Prestige Software, Inc.

Phone: (714) 283-2323, x141; Fax: (714) 283-1029
"Honest, reliable, custom software development.  On-time and on-budget or
your money back!"
Visit us at http://www.prestige-software.com


Quote:
> I have written a formula to repair a formatting problem on an imported
> file.  My problem though, is when I put it in the VB editor I get a
> Run-time error '1004'.

> I have located the source of the problem but don't know how to fix.

> Here is a simplified example of what happens:
> Selection.Formula = "=IF(ISBLANK(A1),"",4)"

> The problem is the "" in the middle of the formula.  Putting this
> formula directly into the spreadsheet works but the "" make the run-time

> error occur.

> I need to get the blank cell returned as a blank cell.  How do I get
> around this?
> Thanx



Sat, 19 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Crystal Report Selection Formula Problem

2. Help with Multilple Selection Formula Problem

3. SELECTION FORMULA PROBLEM-REPOST

4. SELECTION FORMULA PROBLEM-REPOST

5. selection formula problem

6. Using formula field in selection formula

7. Using formula field in selection formula

8. Using formula field in selection formula

9. Problem applying record selection formula

10. Problem passing date in selection formula

11. Problem in sending Selection Formula

12. Problem in Selection formula, CR 4.6, VB 6.0

 

 
Powered by phpBB® Forum Software