Results 1 to 4 of 4

Formula trouble in VBA

Threaded View

  1. #1
    Registered User
    Join Date
    08-04-2009
    Location
    Lismore, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Formula trouble in VBA

    Hi guys,

    I'm getting a compile error before I even get a chance to use it. I'm sure it's simple but it's got me stumped.

    Range("AG1").Select
    
    ActiveCell.Formula = "=LEFT(TRIM(C1),FIND(" ", TRIM(C1))-1)&" "&MID(TRIM(C1),FIND("^^",SUBSTITUTE(TRIM(C1)," ","^^",LEN(TRIM(C1))-LEN(SUBSTITUTE(TRIM(C1)," ",""))))+1,255)"
    
            Selection.AutoFill Destination:=Range("AG1:" & myRangeBASE), Type:=xlFillDefault
    I've underlined and made bold, the area where the error occurs.

    The error is:

    Compile error:
    Expected: end of statement


    Thanks for your time,

    Ciaron
    Last edited by Snurry; 08-09-2009 at 04:37 AM.

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