+ Reply to Thread
Results 1 to 5 of 5

UserForms not running

  1. #1
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    170

    UserForms not running

    Hello Everyone,

    I think I'm running in circles. I'm working on a code that needs to open a Userform. On opening the UserForm needs to (1) open correctly and (2) pull information from the active row into various text and List boxes. The following is a simplified version of my codes:

    Please Login or Register  to view this content.
    However, every time I run this I get the following Error: run-time error '424' object required. I really don't know what I'm doing wrong.

    To satisfy the second criteria I wrote the following code into my Userform:
    Please Login or Register  to view this content.
    There was a brief period where I was able to test the UserForm and this code only pulled information into the TextBoxes but not the ListBoxes. any help on this part would be great too.

    Thanks in advance.

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

    Re: UserForms not running

    There's nothing obvious in that code that could be causing that error, perhaps a typo in a name.

    Anyway. to try and find out what's wrong you could give this a shot.

    Goto the userform module, put the cursor in the Initialize event and then use F8 to step through the code.

    That should help you identify where the problem is.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: UserForms not running

    Well that helped! Apparently the problem was here...

    Please Login or Register  to view this content.
    All of these lines referencing the listboxes was tripping the error. I removed those and the code works fine. So I guess my next question is how can I have that userform open up and (if there is an exact match) have the listbox selection equal the cell contents of a specific cell of my active row. For instance listbox1 = the 6th cell of the active row, if not an exact match then listindex = 0?

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

    Re: UserForms not running

    What are the names of the listboxes on the form?

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  5. #5
    Forum Contributor
    Join Date
    05-31-2013
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: UserForms not running

    Thanks, but I figured it out. It cam down to order. I had my code to populate the cells first with the codes to fill the list boxes second. So when the UserForm opened it couldn't select anything in the listboxes because nothing had been loaded for it yet. I moved
    Please Login or Register  to view this content.
    to the end of my Private Sub UserForm_Initialize () section and everything worked. Thanks a ton 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)

Similar Threads

  1. VBE Toolbox keeps popping up when running Userforms
    By AdLoki in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-17-2021, 05:50 AM
  2. Macro to hide/unhide cells not running or running slow
    By mbp727 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2013, 04:22 PM
  3. Help!? Running/Re-running a SQL Script through Excel (easily?)
    By KOOOP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2013, 02:27 PM
  4. Running total of multiple running totals
    By ashncg in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-09-2011, 05:20 PM
  5. Web queries, Macros, Stop auto-running, Userforms
    By Flashart in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2008, 03:51 PM

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