+ Reply to Thread
Results 1 to 3 of 3

What exactly does userform_initialize do?

  1. #1
    Registered User
    Join Date
    08-16-2015
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Office Mac 2011
    Posts
    5

    What exactly does userform_initialize do?

    I have this Sub where me and my study group have added buttons. It is based on the buttons our teachers have already made (CreateCoffee, CreateDepartment, CreateOwner).
    We have created the buttons "CreateCost" and "CreateProject". In this case, It is the button "CreateProject" that is relevant.
    We also have to give an explanation of each step in the code and that is the reason why I ask you guys.
    We have a problem by understanding what role the "userform_initialize" plays in the code. Can you guys help?
    I add the excel file.
    Attached Files Attached Files

  2. #2
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: What exactly does userform_initialize do?

    Userform_initialize it the very first code that runs and usually brings the form from invisible to visible.

    http://www.homeandlearn.org/the_form...ize_event.html
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: What exactly does userform_initialize do?

    Hi crusam

    The UserForm_Initialize Code does just that...it set's the initial value of the UserForm Controls. In your specific instance the Code populates ComboBoxId and ListBoxOwner using the AddItem method.

    It also sets the Boolean value of NewProject to False.

    To test it's impact comment out the UserForm_Initialize Code then click the Button. You'll see that the UserForm still displays but the Controls are empty.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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] UserForm_Initialize running sub I don't want it to
    By PDBartlett in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2014, 06:34 AM
  2. [SOLVED] Booleans and Userform_initialize()
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-23-2014, 10:42 AM
  3. [SOLVED] Calling a Sub from UserForm_Initialize
    By domino111 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-09-2014, 11:54 AM
  4. UserForm_Initialize() and set up the worksheets
    By mreFF in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2014, 01:01 PM
  5. Private Sub UserForm_Initialize() not run
    By Reemet in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2014, 01:54 PM
  6. [SOLVED] UserForm_Initialize
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-13-2006, 11:52 AM
  7. UserForm_Initialize error
    By Jennifer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2005, 05:07 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