+ Reply to Thread
Results 1 to 6 of 6

Problem with calling another macro (Error 450 and " Expected variable or procedure")

  1. #1
    Registered User
    Join Date
    10-07-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    29

    Problem with calling another macro (Error 450 and " Expected variable or procedure")

    Hello! i'm quite new to vba programming and i've ran in to a problem i can't solve on my own.
    It might be one of the simplest problems ever but i would love some help.

    There are 2 macros, on is supposted to paste todays date and then call the other macro
    which is supposed to copy two cells and paste them in cells XY+1 and then clear the work area.

    This is the first macro:


    Please Login or Register  to view this content.


    and the second one is:



    Please Login or Register  to view this content.


    I hope someone could come up with something to help me and
    I hope i'll learn something from it.

    Have a nice day!!
    Last edited by Roxner; 10-07-2013 at 04:59 AM. Reason: Code tags added

  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
    44,428

    Re: Problem with calling another macro (Error 450 and " Expected variable or procedure")

    I suspect the problem is that Cells is a reserved word. Calling your first subroutine Cells will confuse Excel/VBA. And then you have white instead of while.


    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


  3. #3
    Registered User
    Join Date
    10-07-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Problem with calling another macro (Error 450 and " Expected variable or procedure")

    Im still getting the "Expected variable or procedure, not module" error when i try to run the first macro.
    And it marks the first row yellow. It doesn't seem to work to change the name of the first sub.

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Problem with calling another macro (Error 450 and " Expected variable or procedure")

    Hi Roxner,

    I believe you have a typo in your code

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  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,428

    Re: Problem with calling another macro (Error 450 and " Expected variable or procedure")

    This works through, though there are better ways to get to the next empty cell.

    Please Login or Register  to view this content.

    Regards, TMS

  6. #6
    Registered User
    Join Date
    10-07-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Problem with calling another macro (Error 450 and " Expected variable or procedure")

    thanks a bunch guys! works like a charm!!

+ 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 variable or procedure, not module
    By kaseyleigh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2015, 03:46 PM
  2. [SOLVED] Problem with "Compile error: Expected Fuction or variable"
    By perducci in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2012, 11:59 AM
  3. Calling a Macro gives me an error "Sub or function not defind"
    By AB33 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-04-2012, 04:13 PM
  4. Mac issue (please help) "Compile error: Expected Function or variable"
    By m1notaur in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-22-2011, 06:00 PM
  5. Macro code too long: "Procedure too large" Error
    By nachousa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2010, 03:16 PM

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