+ Reply to Thread
Results 1 to 5 of 5

compile error expected sub

  1. #1
    Registered User
    Join Date
    04-03-2015
    Location
    usa
    MS-Off Ver
    2013
    Posts
    2

    compile error expected sub

    Hi
    I'm caculating on a worksheet, and when I input the code like below, a popup window says "
    Please Login or Register  to view this content.
    ", anyone could give me any help? Thx.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: compile error expected sub

    You're missing a
    Please Login or Register  to view this content.
    line before the end sub
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: compile error expected sub

    That will fix the compile error. However, you will have a problem with the execution of the code. First, if you have two rows that meet the conditions, it will "jump" the second one. You avoid that by starting at the bottom and working up. And you are making a change (deleting a row) which will fire the Change event handler ... probably causing a loop (given you already have a loop)

    Try

    Please Login or Register  to view this content.
    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    04-03-2015
    Location
    usa
    MS-Off Ver
    2013
    Posts
    2

    Re: compile error expected sub

    Thank you romperstomper and TMS, it works

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: compile error expected sub

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Compile Error: Expected End With
    By Robert110 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-14-2013, 07:14 AM
  2. HELP Getting a Compile Error: Expected End With
    By turtles62 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2012, 11:27 PM
  3. VBA Compile Error: Expected End With
    By MLS Packer Lover in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-24-2011, 02:58 AM
  4. Compile error: Expected End Sub
    By Leeboy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-31-2011, 09:44 AM
  5. Compile Error: Expected End Sub
    By Lothar69 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2011, 10:55 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