O
Oak
Would anyone know how to refer to a string inside the
formula property value?
In my case I am checking a named cell to see if it is
holding a specified string and if so want the cell formula
to have the cell with the formula be blank, otherwise have
a value of 2, as per below:
Worksheets(1).Cells(23, 8).Formula _
= "=if(itemnmlnk1 <> "StockOut", "", 2)"
However, though the formula works fine when inserted
directly in the cell, the formla property returns
An "Application-defined or object-defined error". I am
thinking it is because I am using the string quotes inside
the Formula property value quotes and the interpreter is
having a problem with quotes inside of quotes? So I am
thinking there must be some character to type in front of
the quotes to indicate to the interpreter to allow the
quotes to be used in the formula?
Thank you much
formula property value?
In my case I am checking a named cell to see if it is
holding a specified string and if so want the cell formula
to have the cell with the formula be blank, otherwise have
a value of 2, as per below:
Worksheets(1).Cells(23, 8).Formula _
= "=if(itemnmlnk1 <> "StockOut", "", 2)"
However, though the formula works fine when inserted
directly in the cell, the formla property returns
An "Application-defined or object-defined error". I am
thinking it is because I am using the string quotes inside
the Formula property value quotes and the interpreter is
having a problem with quotes inside of quotes? So I am
thinking there must be some character to type in front of
the quotes to indicate to the interpreter to allow the
quotes to be used in the formula?
Thank you much