![]() |
Excel help ... please
How do you assign a text string to a cell that contains quotation marks from a macro.
Worksheets("Worksheet1").Cells(2, 1).Value = "=IF(Worksheet2!A3="","",Worksheet2!A3)" I am trying to get the cell from "Worksheet1" to have the same value as cell A3 from "Worksheet2" and if the cell is blank, then I want the "Worksheet1" cell to also be blank. Just a simple cell=cell is giving me a "0" in the Worksheet1 cell if Worksheet2 blank. I know that there is probably an easy solution, but I am lost. :confused: |
Sounds like the cell has a "Number" format instead of a "General" or "Text" format.
If you want a "Number" format, can't you just set up the format string so "0" is blank? If you want a "Number" format and non-blank zeroes, you may be screwed. |
Is this what you want?
=IF(Sheet2!A3>"",Sheet2!A3, "") |
Quote:
Thanks gstelmack, It seems that when i do a "cell1 = cell2", the result is a "0" in cell1 if cell2 is blank. I've tried different formats and I get the same result. |
Quote:
Thanks Rizon, I am trying to assign this formula from a macro and the "" (quotation marks) are throwing everything off. I need to know how to include "" (quotation marks) within a quote. Worksheets("Worksheet1").Cells(2, 1).Value = "=IF(Worksheet2!A3="","",Worksheet2!A3)" |
I think this would work:
Worksheets("Worksheet1").Cells(2, 1).Value = "=IF(Worksheet2!A3="""","""",Worksheet2!A3)" Just need 4 quotation marks on either side of the comma instead of 2. |
Lurker,
Thank you very much. That did it ! I figured that it was something simple. |
Glad it worked. Anything to put off doing my own Excel work.
|
| All times are GMT -5. The time now is 03:19 AM. |
Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.