+ Reply to Thread
Results 1 to 8 of 8

VBA Code Problem (Excel 2010):Runtime error 424

  1. #1
    Registered User
    Join Date
    11-26-2012
    Location
    Kitchener, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    82

    Arrow VBA Code Problem (Excel 2010):Runtime error 424

    Tried to copy a worksheet and assign a variable to this copy at the same time as follows,

    Please Login or Register  to view this content.
    but I got error message as follow,

    Run-time error '424':
    Object Required

    Any help on this...
    Last edited by arlu1201; 11-27-2012 at 01:06 AM. Reason: Use code tags in future.

  2. #2
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: VBA Code Problem (Excel 2010)

    A. you should have your Code in CodeMarks...
    you have not designated any object i think... though i am not sure if it is neccessaryy...
    If you try...
    Please Login or Register  to view this content.
    Let me know, just a guess, havnt tested it

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

    Re: VBA Code Problem (Excel 2010)

    When you copy a worksheet an object isn't returned.

    What you can do is because the new sheet becomes the active sheet is create a reference to the active sheet immediately after the copy.
    Please Login or Register  to view this content.
    Last edited by Norie; 11-26-2012 at 04:44 PM.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: VBA Code Problem (Excel 2010)

    OK, i understand... i think... as i said, it was just a guess...
    i am learning still as well...
    So the whole code would be...
    Please Login or Register  to view this content.
    ???
    Is that right?
    Last edited by Legend Rubber; 11-26-2012 at 04:17 PM. Reason: Add y to "cop"y

  5. #5
    Registered User
    Join Date
    11-26-2012
    Location
    Kitchener, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: VBA Code Problem (Excel 2010)

    I think I answered my own question. I have done some tests and I found out that I was trying to treat a Boolean expression as an object.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code Problem (Excel 2010)

    Aelgadi,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature below this post.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code Problem (Excel 2010)

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  8. #8
    Registered User
    Join Date
    11-26-2012
    Location
    Kitchener, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: VBA Code Problem (Excel 2010)

    Thanks for your help

+ 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