+ Reply to Thread
Results 1 to 6 of 6

Compile error: Expected end of statement

  1. #1
    Registered User
    Join Date
    08-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    95

    Lightbulb Compile error: Expected end of statement

    Please Login or Register  to view this content.


    i want to put the counters in the [] brackets but i get a compile error expected end of stantement
    Last edited by RoOmIE; 10-08-2013 at 11:20 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Compile error: Expected end of statement

    you need to add & signs when switching from strings to variables in your formula definition:
    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[" & count1 & "],Sheet1!C[" & count1 & "]:C[" & count2 & "],5,FALSE)"

  3. #3
    Registered User
    Join Date
    08-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Compile error: Expected end of statement

    thanks yudlugar ... now if i want to change sheets at every count .. how would i do this ..

  4. #4
    Registered User
    Join Date
    08-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Compile error: Expected end of statement

    Please Login or Register  to view this content.
    this is sort of what i want to do ..

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Compile error: Expected end of statement

    Please Login or Register  to view this content.
    ?

  6. #6
    Registered User
    Join Date
    08-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: Compile error: Expected end of statement

    Thanks.. i am somewhat not used to the language of vba .. but am learning .. thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Compile Error: Expected: End of Statement
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2012, 09:37 AM
  2. [SOLVED] Compile error: Expected end of statement
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 07:12 PM
  3. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  4. Compile Error Expected: End of statement
    By AKarmyguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2010, 02:20 AM
  5. How to fix a Compile Error Expected: End of statement.
    By AKarmyguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2010, 02:19 AM

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