+ Reply to Thread
Results 1 to 10 of 10

Object Required - Error 424

  1. #1
    Registered User
    Join Date
    10-22-2014
    Location
    Ashgabat, Turkmenistan
    MS-Off Ver
    MS OFFICE 2010
    Posts
    6

    Object Required - Error 424

    Hi there,

    The goal of the macro is to copy a named range(table) from one sheet to a specific place in another sheet within the same workbook. The destination cell is bounded by some other text. Here is a sample layout (sample file also attached):

    Some text

    ***Copied table***

    Some text

    The copied table can be of variable size and the "Some text" should wrap that table.

    I came up with the code below but there is a problem when the following line is executed

    Please Login or Register  to view this content.
    However, if I uncomment the following line in the code it works fine

    Please Login or Register  to view this content.
    Below is the full macro code:

    Please Login or Register  to view this content.
    I had to use the "ugly workaround", which is commented out in a code, to make the macro work and it does what I want but I still do not understand why I get that "Object required" error.

    Any help would be appreciated.

    Thank you in advance,
    Merdan
    Attached Files Attached Files
    Last edited by eSpirit; 10-22-2014 at 04:55 AM.

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Object Required - Error 424

    Your post Against Forum Rule , Please Add Code Tag first your post.
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  3. #3
    Registered User
    Join Date
    10-22-2014
    Location
    Ashgabat, Turkmenistan
    MS-Off Ver
    MS OFFICE 2010
    Posts
    6

    Re: Object Required - Error 424

    Fixed it. Thanks Naveed

  4. #4
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Object Required - Error 424

    I think it should be like this...
    Please Login or Register  to view this content.



    Regards,
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  5. #5
    Registered User
    Join Date
    10-22-2014
    Location
    Ashgabat, Turkmenistan
    MS-Off Ver
    MS OFFICE 2010
    Posts
    6

    Re: Object Required - Error 424

    Thank you for your reply Vikas, but unfortunately that didn't work.

  6. #6
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Object Required - Error 424

    Just add below code to above that code where u have mention "Does not work here"
    Please Login or Register  to view this content.

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

    Re: Object Required - Error 424

    Your code deleted cel so it's not a valid range object any more.
    Remember what the dormouse said
    Feed your head

  8. #8
    Registered User
    Join Date
    10-22-2014
    Location
    Ashgabat, Turkmenistan
    MS-Off Ver
    MS OFFICE 2010
    Posts
    6

    Re: Object Required - Error 424

    Thank you Naveed, It works. But I've got a question... Given that I've set the cel right after the "Private Sub" statement, why did it loose scope inside that sub?

    Thank you in advance,
    Merdan

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

    Re: Object Required - Error 424

    It didn't lose scope, you deleted it.
    If posting code please use code tags, see here.

  10. #10
    Registered User
    Join Date
    10-22-2014
    Location
    Ashgabat, Turkmenistan
    MS-Off Ver
    MS OFFICE 2010
    Posts
    6

    Re: Object Required - Error 424

    Thank you everybody for your help! Really appreciate it!

    Regards,
    Merdan

+ 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. [SOLVED] Simple Calendar pop up macro --> error Run-time error '424': Object required
    By am_hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 10:38 AM
  2. [SOLVED] Object Required Error
    By Steve0492 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2012, 06:36 PM
  3. [SOLVED] Object Required error
    By HuskerBronco in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-20-2011, 12:56 PM
  4. Name.Object (Error Object Required)
    By dssrun209 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2010, 01:38 PM
  5. Error 424 Object Required Error when Using AddItem to ListBox Generated in Code
    By jclark419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 12:47 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