+ Reply to Thread
Results 1 to 4 of 4

compile error expected line number statement end statement

  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    compile error expected line number statement end statement

    I am getting this error and where th If not starts its is in red showing that is where the issue is


    HTML Code: 

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: compile error expected line number statement end statement

    What rows are you trying to remove?

    If it's rows that match/don't match a list of values then I'm sure there are better ways to do this rather than the huge Or expression you are trying to use.

    For example you could use Application.Match to see if a value in a cell is in the list of values.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: compile error expected line number statement end statement

    The current range I am working is is about 85,000 rows long. I need to delete any rows that down contain a certain value in column "B". The list of values to look for in B is 100 values and they are in a worksheet called "100 Airports" in range E4:E103.

    I am trying to find the best way to do this because I have other sheets that are huge that contain formulas that search that huge range and it is going so slow. If I can cut the 85,000 rows with the data the formulas is searching for it will hopeffuly speed things up.

    What are your thoughs? Thanks for the help

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Like I suggested use Application.Match to see if the value in the cell from column B is in the list in column E on the other sheet.

    If it is delete the row.

+ 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. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  2. [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
  3. [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
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  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