+ Reply to Thread
Results 1 to 9 of 9

Syntax error?

  1. #1
    Registered User
    Join Date
    06-20-2006
    Posts
    15

    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 the syntax here?

  2. #2
    Gary Keramidas
    Guest

    Re: Syntax error?

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

    --


    Gary


    "cooldyood" <cooldyood.2ccsvj_1155262814.8071@excelforum-nospam.com> wrote in
    message news:cooldyood.2ccsvj_1155262814.8071@excelforum-nospam.com...
    >
    > 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. #3
    Registered User
    Join Date
    06-20-2006
    Posts
    15
    I tried that but the macro got stuck at that line. XL froze, I had to kill it.

  4. #4
    Registered User
    Join Date
    06-20-2006
    Posts
    15
    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,"""")"

  5. #5
    Dave Peterson
    Guest

    Re: 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. #6
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Damn Dave your good, thats why i always look forward to your responses!

    Regards,
    simon

  7. #7
    Dave Peterson
    Guest

    Re: 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. #8
    Registered User
    Join Date
    06-20-2006
    Posts
    15
    Yes, it works if I manually put that formula in.

  9. #9
    Dave Peterson
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1