+ Reply to Thread
Results 1 to 6 of 6

compile error: sub or function not defined

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    richmond
    MS-Off Ver
    Excel 2010
    Posts
    4

    compile error: sub or function not defined

    I am trying to write a macro that will search through a cell that contains the abstract, title, and author keywords of a paper so that I can determine which industry it applies to based on a list of keywords that i have specified. I had orginally written an excel formula for it using ISNUMBER(SEARCH but since I have over 33,000 papers and 24 different industries I am searching for my excel file became to large and my computer was constantly crashing. My Tech guy told me to write a macro that will perform this to stop my computer from crashing. The code I have below only applies to one industry but can someone help me solve my compiling issue as well as fix my code? I have looked at other threads to try to debug my issue and I have checked the Solver box in references but my first line of code is still highlighted in yellow and the error still comes up.

    Please Login or Register  to view this content.
    Additionally the industry keywords i have created are in a separate worksheet from the worksheet I am trying edit. I don't know if that is not possible or makes a difference in what I'm trying to accomplish. Thanks!
    Last edited by Cutter; 08-16-2012 at 07:48 PM. Reason: Added code tags

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: compile error: sub or function not defined

    Please put your code in tags,
    Either "DoEvents" does not exist or you have mistyped the macro name or function name, or the code below is the problem.

    Change the line in your code that = = "aerospace" line needs to be this,

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: compile error: sub or function not defined

    Before resorting to code, have you tried using advanced filtering?
    Last edited by Cutter; 08-16-2012 at 07:50 PM.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: compile error: sub or function not defined

    @ eaglefana101

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: compile error: sub or function not defined

    Before you can use the Solver VBA functions in the Visual Basic Editor, you must establish a reference to the Solver add-in. In the Visual Basic Editor, with a module active, click References on the Tools menu, and then select Solver under Available References. If Solver does not appear under Available References, click Browse, and then open Solver.xlam in the \Program Files\Microsoft Office\Office14\Library\SOLVER subfolder.

    Alf

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: compile error: sub or function not defined

    Hi

    Try changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    There is no reference cells(0,2) which the first pass of your loop would try to action.

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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