+ Reply to Thread
Results 1 to 5 of 5

Call function not working

  1. #1
    Registered User
    Join Date
    06-08-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    41

    Call function not working

    Hi guys i am trying to call a macro which i have recorded in a spreadsheet, dont know what is happening to it but it seems to be giving me an error. I am using a simple comand buttone to call 2 macros, one of them is working perfectly but the other one is giving me an error. below is the code:

    Please Login or Register  to view this content.
    On clicking this button vba gives me a compile error, saying 'Expected variable or procedure,not module'.

    However if i omit this one and just have the second macro it works fine.
    I have tried moving this to other places in the worksheet to trigger it but everywhere it is giving me an error. Thus im guessing it might be an error with the macro itself which is as below:

    Please Login or Register  to view this content.
    Could you guys have a look at this and let me know what is going wrong here, i was working on this a couple of hours ago and both the macros were working fine, no problems at all, dont know why its doing this now.

    Regards,
    Abz
    Last edited by abz; 07-19-2010 at 07:16 PM.

  2. #2
    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
    48,506

    Re: Call function not working

    When you are coding inside a WITH statement, you need to precede the RANGEs with a full stop / period.

    You don't do this consistently.

    Please Login or Register  to view this content.
    Try:

    Please Login or Register  to view this content.

    and check the rest of the RANGEs and CELLS, etc

    Regards

  3. #3
    Registered User
    Join Date
    06-08-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Call function not working

    Tried all that, still no resolution, the thing is if i run the macro completely separately, it works fine again, no problems.

    Its just not calling that particular macro and its thinking of it as something other than a call statement.

  4. #4
    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
    48,506

    Re: Call function not working

    Post the corrected code and/or a sample workbook

    Regards

  5. #5
    Registered User
    Join Date
    06-08-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Call function not working

    Guys,

    Problem just been solved, i had changed the name of the module in the properties pane on the left, i changed it back to Module 1 and its working again as usual.

    Regards,
    Abz

+ 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