+ Reply to Thread
Results 1 to 5 of 5

Sub or Function not defined

  1. #1
    Registered User
    Join Date
    03-22-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    2

    Sub or Function not defined

    Hi everyone,

    As a beginner, I am facing a problem in VBA programming: yesterday the macro was working fine and today it is not. Indeed I have the msg box telling me that "Compile error: Sub or Function not defined".

    I have looked on google, but I hardly see how the references would be impacting any of this and I did not change much of the code so I don't know where it can come from.

    Here is my code. Btw if you have any remarks on my code, please let me know, i'm still in the learning process.


    Please Login or Register  to view this content.

    Thank you for your help, I know my code is far from perfect, but I just want it to work.
    Cheers~



    EDIT***
    So i actually changed the second line 'Workheets("VAR NUM").Activate' and deleted it so it worked. I would like to understand why activating a specific worksheet in an open file makes it not work anymore... can somebody clarify this please?
    Last edited by lchk; 03-23-2011 at 04:33 AM. Reason: New elements on my side

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

    Re: Sub or Function not defined

    Simple typo:
    Please Login or Register  to view this content.
    should be:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    03-22-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Sub or Function not defined

    God, how can I be blind at this point. Sorry for disturbing and thanks.

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

    Re: Sub or Function not defined

    Don't worry - we've all been there.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Sub or Function not defined

    Please Login or Register  to view this content.



+ Reply to Thread

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