ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Failing to assign expression to FormulaR1C1, what am I doing wrong? (https://www.excelbanter.com/excel-programming/310529-failing-assign-expression-formular1c1-what-am-i-doing-wrong.html)

SysRq2000

Failing to assign expression to FormulaR1C1, what am I doing wrong?
 

Hi. I have the following two lines in a macro to copy/paste the sam
expression to about 23000 rows.

Sheet2.Range("B2").FormulaR1C1
"=OR(ISBLANK(RC15);ISBLANK(RC16))"
Sheet2.Range("B2").Copy Sheet2.Range("B2:B" & g_LastRowIndex)

However when the first line is executed it fails with
"Application-defined or object-defined error" message, aka. error 1004
What am I doing wrong? Btw, if you remove the "OR" statement from th
expression, the line doesn't fail... Isn't that odd?

Thx in advance,
Johanne

--
SysRq200
-----------------------------------------------------------------------
SysRq2000's Profile: http://www.excelforum.com/member.php...fo&userid=1453
View this thread: http://www.excelforum.com/showthread.php?threadid=26153


Jim May

Failing to assign expression to FormulaR1C1, what am I doing wrong?
 
Try (in your OR Statement) replacing the ; with a ,

"SysRq2000" wrote in message
...

Hi. I have the following two lines in a macro to copy/paste the same
expression to about 23000 rows.

Sheet2.Range("B2").FormulaR1C1 =
"=OR(ISBLANK(RC15);ISBLANK(RC16))"
Sheet2.Range("B2").Copy Sheet2.Range("B2:B" & g_LastRowIndex)

However when the first line is executed it fails with a
"Application-defined or object-defined error" message, aka. error 1004.
What am I doing wrong? Btw, if you remove the "OR" statement from the
expression, the line doesn't fail... Isn't that odd?

Thx in advance,
Johannes


--
SysRq2000
------------------------------------------------------------------------
SysRq2000's Profile:

http://www.excelforum.com/member.php...o&userid=14530
View this thread: http://www.excelforum.com/showthread...hreadid=261539





All times are GMT +1. The time now is 06:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com