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

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



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

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

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


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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
runtime error: syntax error or access violation oucsester[_2_] Excel Programming 1 May 3rd 06 05:51 PM
runtime error: syntax error or access violation oucsester Excel Programming 0 May 3rd 06 02:22 PM
variable not declared error & syntax error G. Beard Excel Programming 1 October 6th 05 09:16 PM
Syntax Error help Markantesp Excel Programming 1 March 8th 05 09:51 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"