+ Reply to Thread
Results 1 to 7 of 7

Error opening userform (clicking button)

  1. #1
    Registered User
    Join Date
    08-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    39

    Error opening userform (clicking button)

    Hello,

    Thank you for your time and expertise!

    The file: ExampleFile.xlsm - image of error segment below

    The whole workbook is intended to be a vacation calendar for a company department, where employees can input their vacation requests. When using the macro, the error appears to occur at the "RetractRequestForm.show", but I think the actual error is located somewhere in the RetractRequestForm - Initialize section. Here is the section: RetractRequestForm.Initialize.JPG

    This is intended to load the visible rows of a table (filtered) into a multicolumn listbox.

    I appreciate your time and thoughts.

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

    Re: Error opening userform (clicking button)

    ActiveCell isn't a property of a worksheet, also using Rows.Count in this case will always return 1.

    Try replacing this,
    Please Login or Register  to view this content.
    with this.
    Please Login or Register  to view this content.
    Actually try replacing the Initialize sub with this.
    Please Login or Register  to view this content.
    By the way, there seems to be quite a few errors throughout the code.

    If you goto Debug>Compile then you should see what I mean.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    08-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Error opening userform (clicking button)

    Hi Norie,

    I appreciate the code you provided, it works very well.

    One other question: I am wondering if there is a change to the code that will make it so there are only visible rows that show up in the multicolumn listbox? Here is what I have tried and it leads to error: RetractRequestForm.Initialize.JPG

    Thank you,

    Adam

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Error opening userform (clicking button)

    Hi Adam,

    Try this line of code...

    Please Login or Register  to view this content.
    ...on the line that is erroring out and see how that goes.

    Regards,

    Robert
    Last edited by Trebor76; 11-24-2014 at 12:39 AM.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Registered User
    Join Date
    08-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Error opening userform (clicking button)

    Robert,

    The code you provided works! Thanks for the help.


    Adam

  6. #6
    Registered User
    Join Date
    08-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Error opening userform (clicking button)

    Robert,

    The code you provided works! Thanks for the help.


    Adam

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Error opening userform (clicking button)

    The code you provided works! Thanks for the help.
    You're welcome and thanks for the rep

    If you could mark the thread as solved it would be appreciated.

    Regards,

    Robert

+ 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. Opening and closing workbooks using userform button issues!!
    By BuenosDias in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-13-2014, 11:04 AM
  2. [SOLVED] Close UserForm after clicking OK Button
    By david1987 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2013, 08:15 AM
  3. Error message when clicking on a command button asigned a macro
    By steve123456 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2012, 01:43 AM
  4. Clicking Red X on UserForm produces run-time error '91'
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2008, 04:38 PM
  5. how to prevent user from clicking a button on error
    By ballack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2007, 12:17 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