ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help in syntax (https://www.excelbanter.com/excel-programming/324093-help-syntax.html)

James

help in syntax
 
I am trying to write the following formula into cell.

.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(COUNTIF("&rRange & "," & sCell&")1,TRUE,FALSE)"

where rRange and sCell are range variables.
I got syntax error.
Would anyone help?

Thanks in advance.



Ajtb

help in syntax
 
Hi
I think this will work.

..FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(COUNTIF(rRange , sCell)1,TRUE,FALSE)"


Regards
Andrew Bourke



james wrote:
I am trying to write the following formula into cell.

.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(COUNTIF("&rRange & "," & sCell&")1,TRUE,FALSE)"

where rRange and sCell are range variables.
I got syntax error.
Would anyone help?

Thanks in advance.



Bob Phillips[_6_]

help in syntax
 
You don't give us much help, but assuming that rRange is a range variable
and sCell is a string variable setup earlier in the code, you could try

.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(COUNTIF(" & rRange.Address & ",""" & sCell &
""")1,TRUE,FALSE)"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"james" wrote in message
...
I am trying to write the following formula into cell.

.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(COUNTIF("&rRange & "," & sCell&")1,TRUE,FALSE)"

where rRange and sCell are range variables.
I got syntax error.
Would anyone help?

Thanks in advance.






All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com