ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Syntax error? (https://www.excelbanter.com/excel-programming/370058-syntax-error.html)

cooldyood[_10_]

Syntax error?
 

ActiveCell.FormulaR1C1 = "=if(Countif($J:$J,E2)=1,E2,"""")"

My macro keeps throwing an error at this line. Is there an error in th
syntax here

--
cooldyoo
-----------------------------------------------------------------------
cooldyood's Profile: http://www.excelforum.com/member.php...fo&userid=3561
View this thread: http://www.excelforum.com/showthread.php?threadid=57059


Gary Keramidas

Syntax error?
 
try this
ActiveCell.Formula = "=if(Countif($J:$J,E2)=1,E2,"""")"

--


Gary


"cooldyood" wrote in
message ...

ActiveCell.FormulaR1C1 = "=if(Countif($J:$J,E2)=1,E2,"""")"

My macro keeps throwing an error at this line. Is there an error in the
syntax here?


--
cooldyood
------------------------------------------------------------------------
cooldyood's Profile:
http://www.excelforum.com/member.php...o&userid=35611
View this thread: http://www.excelforum.com/showthread...hreadid=570597




cooldyood[_11_]

Syntax error?
 

I tried that but the macro got stuck at that line. XL froze, I had to
kill it.


--
cooldyood
------------------------------------------------------------------------
cooldyood's Profile: http://www.excelforum.com/member.php...o&userid=35611
View this thread: http://www.excelforum.com/showthread...hreadid=570597


cooldyood[_12_]

Syntax error?
 

Any other suggestions? Is there a syntax error on this line? I've tried
the following:

ActiveCell.FormulaR1C1 = "=if(Countif($J:$J,E2)=1,E2,"""")"
ActiveCell.Formula = "=if(Countif($J:$J,E2)=1,E2,"""")"


--
cooldyood
------------------------------------------------------------------------
cooldyood's Profile: http://www.excelforum.com/member.php...o&userid=35611
View this thread: http://www.excelforum.com/showthread...hreadid=570597


Dave Peterson

Syntax error?
 
The first line won't work--you're using .formulaR1C1 with A1 reference style
(J:J and E2).

If you put this in the activecell manually, does excel continue to work ok:
=if(Countif($J:$J,E2)=1,E2,"")

I don't see anything with the formula or the second sample of code.



cooldyood wrote:

Any other suggestions? Is there a syntax error on this line? I've tried
the following:

ActiveCell.FormulaR1C1 = "=if(Countif($J:$J,E2)=1,E2,"""")"
ActiveCell.Formula = "=if(Countif($J:$J,E2)=1,E2,"""")"

--
cooldyood
------------------------------------------------------------------------
cooldyood's Profile: http://www.excelforum.com/member.php...o&userid=35611
View this thread: http://www.excelforum.com/showthread...hreadid=570597


--

Dave Peterson

Simon Lloyd[_872_]

Syntax error?
 

Damn Dave your good, thats why i always look forward to your responses!

Regards,
simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=57059


Dave Peterson

Syntax error?
 
But who knows why it's locking up????

Simon Lloyd wrote:

Damn Dave your good, thats why i always look forward to your responses!

Regards,
simon

--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=570597


--

Dave Peterson

cooldyood[_13_]

Syntax error?
 

Yes, it works if I manually put that formula in

--
cooldyoo
-----------------------------------------------------------------------
cooldyood's Profile: http://www.excelforum.com/member.php...fo&userid=3561
View this thread: http://www.excelforum.com/showthread.php?threadid=57059


Dave Peterson

Syntax error?
 
I still don't have another guess.

Sorry.

cooldyood wrote:

Yes, it works if I manually put that formula in.

--
cooldyood
------------------------------------------------------------------------
cooldyood's Profile: http://www.excelforum.com/member.php...o&userid=35611
View this thread: http://www.excelforum.com/showthread...hreadid=570597


--

Dave Peterson


All times are GMT +1. The time now is 12:18 PM.

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