Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Text in Formula

Hi,

Having problem getting text into formula:

Need to have the following formula in cell(1):

=if(b1="B", "", "Match")

The following code does not work:

Cells(1).formula= "=if(" & Cells(2).address & "=" & ""B""
& "," & """" & "," & ""Match"" & ")"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Text in Formula

Hi

"=if(" & Cells(2).Address & "=B,"""",""Match"")"

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Tony Di Stasi" skrev i melding
...
Hi,

Having problem getting text into formula:

Need to have the following formula in cell(1):

=if(b1="B", "", "Match")

The following code does not work:

Cells(1).formula= "=if(" & Cells(2).address & "=" & ""B""
& "," & """" & "," & ""Match"" & ")"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Text in Formula

"Tony Di Stasi" wrote...
...
Need to have the following formula in cell(1):

=if(b1="B", "", "Match")

The following code does not work:

Cells(1).formula= "=if(" & Cells(2).address & "=" & ""B"" & _
"," & """" & "," & ""Match"" & ")"


A few things. If you want B1 rather than $B$1, add some parameters to that
Address call - Cells(2).Address(0, 0). Aside from that, you're not doubling your
embedded double quotes. To get "" as a result, you need to start with """"""
rather than """". So try

Cells(1).Formula= "=IF(" & Cells(2).Address(0, 0) & "=" & """B""" & _
"," & """""" & "," & """Match""" & ")"

--
Never attach files.
Snip unnecessary quoted text.
Never multipost (though crossposting is usually OK).
Don't change subject lines because it corrupts Google newsgroup archives.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested formula to search a text string and return specific text Barbie Excel Worksheet Functions 10 February 21st 09 07:40 AM
Formula Text String: Formatting Text and Numbers? dj479794 Excel Discussion (Misc queries) 5 June 30th 07 12:19 AM
Excel:Get concatenated text to be recognised as formula not text? yvette Excel Discussion (Misc queries) 5 January 15th 07 07:32 PM
Formula to count text and alert me if a text appears more than twi Mike Excel Discussion (Misc queries) 1 August 29th 05 09:53 PM
match cell text with text in formula Todd L. Excel Worksheet Functions 3 December 9th 04 08:11 PM


All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"