Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Run Time Error 1004 - Application-defined or object-defined error

Can someone tell me why this formula gives me a run time eror?
Range("E2").Formula = "=IF( AND( NOT(G2),
NOT(ISBLANK(B2)),NOT(ISBLANK(I2))),TODAY()-I2,"" )"

or why this also gives the same error?
Range("E2").Formula = "=IF(G2,I2,"")"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Run Time Error 1004 - Application-defined or object-defined error

Quotes inside quotes. Try this in the immediate pane:
? "=IF(G2,I2,"")"
you should get
=IF(G2,I2,")
which is an invalid formula and therefore the error. Solution is to use ""
wherever you want ", so """" for "":
Range("E2").Formula="=IF(G2,I2,"""")"
and similarly for your other formula
--
- K Dales


"brent" wrote:

Can someone tell me why this formula gives me a run time eror?
Range("E2").Formula = "=IF( AND( NOT(G2),
NOT(ISBLANK(B2)),NOT(ISBLANK(I2))),TODAY()-I2,"" )"

or why this also gives the same error?
Range("E2").Formula = "=IF(G2,I2,"")"

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run Time Error 1004 - Application-defined or object-defined error

Range("E2").Formula = "=IF(G2,I2,"""")"

do the same for your other formula.

double quotes within quotes

--
Regards,
Tom Ogilvy

"brent" wrote in message
...
Can someone tell me why this formula gives me a run time eror?
Range("E2").Formula = "=IF( AND( NOT(G2),
NOT(ISBLANK(B2)),NOT(ISBLANK(I2))),TODAY()-I2,"" )"

or why this also gives the same error?
Range("E2").Formula = "=IF(G2,I2,"")"



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
Run-time Error 1004: Application-defined or Object-defined Error Adrian Excel Programming 6 August 23rd 05 06:28 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM
"Run Time Error 1004 Application Defined or Object Defined Error." BJC Excel Programming 4 October 26th 03 03:09 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"