Complie Error: Expected End of Statement when entering code that enters a formula in a cell
Posted by Chris on December 13, 2001 12:07 PM
Im using VBA to enter a formula in a cell. Here's the formula:
=TEXT($B$1,"mm/dd/yy")&" "&(TEXT(B3,"hh:mm AM/PM")))+0
When I type
"==TEXT($B$1,"mm/dd/yy")&" "&(TEXT(B3,"hh:mm AM/PM")))+0" in my VBA module, I get a Visual Basic error: Expected: end of statement when it hits the first set of quotation marks in my formula.
Is there a proper syntax to use so the macro doesn't mistake the quotation marks in my formula for the quotation marks at the end?