+ Reply to Thread
Results 1 to 15 of 15

424 Error: Object Required (and I am not sure how to fix

  1. #1
    jjward101
    Guest

    424 Error: Object Required (and I am not sure how to fix

    When i run the below code, I am getting the 424 error Object required.
    I have searched, but cannot find a solution that actually works.
    The first sub opens a userform for the purpose of entering data, and the
    second one recalls the userform and allows search of data.

    If anyone could point out where i am missing the mark, that would be wonderful. Thanks


    Please Login or Register  to view this content.
    Last edited by jjward101; 01-06-2022 at 10:11 AM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,295

    Re: 424 Error: Object Required (and I am not sure how to fix

    you have a lower case "L" in this line instead of a numeral "1" ????
    Please Login or Register  to view this content.
    Please enclose your code with code tags a required by forum rules.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    jjward101
    Guest

    Re: 424 Error: Object Required (and I am not sure how to fix

    apologies. fixed.

  4. #4
    jjward101
    Guest

    Re: 424 Error: Object Required (and I am not sure how to fix

    I did fox the lower cased "L', but am still getting the same erorr.
    Debug shows the error being in this line:
    Please Login or Register  to view this content.

  5. #5
    jjward101
    Guest

    Re: 424 Error: Object Required (and I am not sure how to fix

    If anyone has some advice, i would be grateful

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,295

    Re: 424 Error: Object Required (and I am not sure how to fix

    using your methodology, you were missing a textbox to take the i.d. put the item from column A in textbox1 and press find - to add a new row fill all textboxes and press save.
    you can save much code by looping through the textboxes - this becomes significant especially on a large app with a great many data points to save.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    jjward101
    Guest

    Re: 424 Error: Object Required (and I am not sure how to fix

    Thank you very much. I have input your code on the form, but it does not seem to be working. Workbook is attached, if you'd like to take a look....
    Attached Files Attached Files

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,295

    Re: 424 Error: Object Required (and I am not sure how to fix

    you have put the code in a separate module, it should be in the userform module that it refers.
    to work with separate modules you will have to learn about public and global variables and how to pass them between each module.
    make it easy on yourself use one userform and keep all the code in the one userform - declare all your variables at the head of the form, with the statement "Option Explicit" as your very first line, this will then enable you to run debug and throw-up most of your errors.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: 424 Error: Object Required (and I am not sure how to fix

    Why are you looping to find a match...Why not Just Find Or Match code snippet...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  10. #10
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,295

    Re: 424 Error: Object Required (and I am not sure how to fix

    @sintek, I left it as the O.P. method - small steps at a time

  11. #11
    jjward101
    Guest

    Re: 424 Error: Object Required (and I am not sure how to fix

    Quote Originally Posted by sintek View Post
    Why are you looping to find a match...Why not Just Find Or Match code snippet...
    I am very new at this, and did not realize there was a better way.

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: 424 Error: Object Required (and I am not sure how to fix

    One other option...

    I assume it is the code for UserformSearch
    Please Login or Register  to view this content.

  13. #13
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,295

    Re: 424 Error: Object Required (and I am not sure how to fix

    The weakness of Excel/VBA is there are a dozen methods of doing the same thing, use what you understand at first, then experiment, but do not use code that you do not comprehend. After more years than I would admit to, I have a mental block using libraries and collections, although simple in principle I find my self overthinking the process.
    It is still my preferred method to dump everything into an array to manipulate it rather than writing/reading the sheet all the time.

  14. #14
    jjward101
    Guest

    Re: 424 Error: Object Required (and I am not sure how to fix

    Quote Originally Posted by sintek View Post
    One other option...

    I assume it is the code for UserformSearch
    Please Login or Register  to view this content.
    This WAS working perfectly, but then i went and changed the sales rep field to a combobox, and now i am getting an 'unable to locate specified object' error, with "Next I" highlighted. Is there an easy fix?

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: 424 Error: Object Required (and I am not sure how to fix

    Is there an easy fix?
    Yes...That loop code references TextBoxes only...Need to reference that 1 Combobox
    Assumes Textbox3 became ComBoBox1

    Please Login or Register  to view this content.
    Or simply to understand...
    Please Login or Register  to view this content.


    Also...No need to quote entire posts...It just clutters the thread...
    Last edited by sintek; 01-07-2022 at 02:04 AM.

+ 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. Return Value of CheckBox object in a worksheet. Error "Object Required"
    By virgilio in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2020, 03:25 PM
  2. VBA Error Message - Runtime Error 424 Object Required
    By jackiea6363 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-26-2017, 04:23 AM
  3. Object Required Error
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2014, 10:49 AM
  4. [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
  5. Name.Object (Error Object Required)
    By dssrun209 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2010, 01:38 PM
  6. 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
  7. Error 424 object required
    By Ranpak in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2008, 09:56 AM

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