![]() |
|
|
#1 | ||
|
High School JV
Join Date: Apr 2003
Location: Akron, OH
|
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. ![]() |
||
|
|
|
|
|
#2 |
|
Pro Starter
Join Date: Oct 2000
Location: Cary, NC
|
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.
__________________
-- Greg -- Author of various FOF utilities |
|
|
|
|
|
#3 |
|
Pro Starter
Join Date: Mar 2004
Location: Oakland, CA
|
Is this what you want?
=IF(Sheet2!A3>"",Sheet2!A3, "") |
|
|
|
|
|
#4 | |
|
High School JV
Join Date: Apr 2003
Location: Akron, OH
|
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. |
|
|
|
|
|
|
#5 | |
|
High School JV
Join Date: Apr 2003
Location: Akron, OH
|
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)" |
|
|
|
|
|
|
#6 |
|
High School JV
Join Date: May 2001
|
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. Last edited by lurker : 02-01-2005 at 04:25 PM. |
|
|
|
|
|
#7 |
|
High School JV
Join Date: Apr 2003
Location: Akron, OH
|
Lurker,
Thank you very much. That did it ! I figured that it was something simple. |
|
|
|
|
|
#8 |
|
High School JV
Join Date: May 2001
|
Glad it worked. Anything to put off doing my own Excel work.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|