View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Atif Atif is offline
external usenet poster
 
Posts: 27
Default Worksheet If Statement in VBA

I am using following line of code:

Range("M" & vTargetRow).Formula = _
"=IF(AND(""F" & vTargetRow = "Standard Desktop"",""G" & vTargetRow =
"Standard 17" & """" & " Monitor""),1,"")"

Instead displaying 1 if condition true or <blank if false, it fill
TargetCell with "FALSE".

IF statemetn is fine if directely entered in Worksheet
(=IF(AND(F500="Standard Desktop",G500="Standard 17"&""""&" Monitor"),1,""))