Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.




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
VBA syntax dhstein Excel Discussion (Misc queries) 3 March 13th 09 12:53 PM
IRR Syntax Bruce Excel Worksheet Functions 1 July 13th 07 09:02 PM
If then syntax RL Excel Worksheet Functions 3 June 22nd 05 05:30 AM
Need some syntax help, please MARTY Excel Programming 3 July 4th 04 04:36 PM
syntax Don[_13_] Excel Programming 2 November 16th 03 03:30 AM


All times are GMT +1. The time now is 05:59 AM.

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"