Thread: Wild Cards
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
KarenF KarenF is offline
external usenet poster
 
Posts: 49
Default Wild Cards

It works! I don't understand why, but this is exactly what I need, thanks ...

KarenF

"Vergel Adriano" wrote:

You can use the IF Function...

ActiveCell.FormulaR1C1 = "=IF(ISNUMBER(SEARCH(""ABC"",RC[-14])), 2.5, 1.5)"


--
Hope that helps.

Vergel Adriano


"KarenF" wrote:

Close! The problem is instead of TRUE or FALSE, I actually want to return a
couple different values. (2.5 if true, 1.5 if false, to be exact.) Is there
a place to plug the desired results into your formula?

Karen F

"Barb Reinhardt" wrote:

How about

ActiveCell.FormulaR1C1 = "=ISNUMBER(SEARCH(""ABC"",RC[-14]))"

HTH,
Barb Reinhardt



"KarenF" wrote:

Hello all,

I'm trying to use a wild card to look up a value in column B to populate
column P. All I'm trying to do is a "contains" ABC.

The same statement without the wild card works.

Range("P2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-14]=""ABC"",True,False)"

But as soon as I introduce the wild card, everything comes up false.

Range("P2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-14]=""=*ABC*"",True,False)"

I stole the wild card argument from an auto-filter statement, because I
didn't know what else to do. (I'm not a programmer.)

I suspect it's the quotes I have wrong, but I've tried every possible
combination and still can't get it to work. A simple fix, I hope?

Karen F