Hi to all,
I tried to declare some complex expression in vba sentence putting formula in one cell. My sentence include definition of some constant with quote sign(s). Lets simplified, I have to put formula =if(a1="OK";1;2) to the cell by vba code.
The problem arises when the VBA code define a string to be passed into the cell because it is a string enclosed in quotation marks himself. Quotes contained within the string causing the error. I tried to define the quotation mark using chr function chr (34), and merged the full expression with concatenation, but again there is a mistake.
Does anyone know how to make the above formula could be realized?
My real formula is much complicate than this example, but problem is the same - not possible to put quotation mark consisting in definition of formula need to put in cell by vba code.
Bookmarks