Front Office Football Central  

Go Back   Front Office Football Central > Archives > FOFC Archive
Register FAQ Members List Calendar Mark Forums Read Statistics

Reply
 
Thread Tools
Old 01-31-2005, 05:14 PM   #1
Silver Owl
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.

Silver Owl is offline   Reply With Quote
Old 01-31-2005, 09:28 PM   #2
gstelmack
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
gstelmack is offline   Reply With Quote
Old 01-31-2005, 09:45 PM   #3
Rizon
Pro Starter
 
Join Date: Mar 2004
Location: Oakland, CA
Is this what you want?

=IF(Sheet2!A3>"",Sheet2!A3, "")
__________________
Quote:
Originally Posted by Pumpy Tudors View Post
It's hard to throw a good shot with a drunk blonde wrapped around me.
Quote:
Originally Posted by Suicane75 View Post
I don't think I'd stop even if I found a dick.
Rizon is offline   Reply With Quote
Old 02-01-2005, 04:12 PM   #4
Silver Owl
High School JV
 
Join Date: Apr 2003
Location: Akron, OH
Quote:
Originally Posted by gstelmack
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.

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.
Silver Owl is offline   Reply With Quote
Old 02-01-2005, 04:19 PM   #5
Silver Owl
High School JV
 
Join Date: Apr 2003
Location: Akron, OH
Quote:
Originally Posted by Rizon
Is this what you want?

=IF(Sheet2!A3>"",Sheet2!A3, "")

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)"
Silver Owl is offline   Reply With Quote
Old 02-01-2005, 04:25 PM   #6
lurker
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.
lurker is offline   Reply With Quote
Old 02-01-2005, 04:48 PM   #7
Silver Owl
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.
Silver Owl is offline   Reply With Quote
Old 02-01-2005, 04:55 PM   #8
lurker
High School JV
 
Join Date: May 2001
Glad it worked. Anything to put off doing my own Excel work.
lurker is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -5. The time now is 06:47 AM.



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.