Thread: Newbie IF
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Newbie IF

It's VBA Jeff

Range("D241") = IIf(Range("D237") = Range("D239"), "1", "2")

or

Range("D241") = (Range("D237") = Range("D239")) * 1 + 2

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JeffP " wrote in message
...
It seemed like a simple fix,but it still doesn't work.
BTW, a simple If Function does work but I'm trying to learn VB.

This function returns a "1"

=IF(D239=D237,"1","2")

Still wonderin'
jeff


---
Message posted from http://www.ExcelForum.com/