+ Reply to Thread
Results 1 to 10 of 10

Userform - help with initialize

  1. #1
    Registered User
    Join Date
    01-19-2009
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    29

    Userform - help with initialize

    Hi,

    I have trouble with userform, my textbox is not filled out unless I click on it. I want it to automatically be filled when I initialize it.

    Please Login or Register  to view this content.
    Last edited by Macster; 01-23-2009 at 05:38 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You need the code in the initialize event not the textbox change

    Please Login or Register  to view this content.
    Last edited by royUK; 01-23-2009 at 05:26 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Roy beat me to it (when I "previewed post"), but to add to his suggestion I recommend adding this line of code at the end of your sub:
    Please Login or Register  to view this content.
    hth
    Rob
    Last edited by broro183; 01-23-2009 at 03:26 AM. Reason: Ooopps! Roy not Ron!
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  4. #4
    Registered User
    Join Date
    01-19-2009
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    29
    Hmm, still not working, I've tried something as simple as

    Please Login or Register  to view this content.
    But it's still not working...

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    How are you adding the code/ Is it in the UserForm module?

    Attach the workbook containing he userform

  6. #6
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Can you please attach an example workbook?

    Is your text box actually called "Txtbox"?
    Click on it in VBE & press [F4] to bring up the properties & name will be listed somewhere in the property list.

    Rob

  7. #7
    Registered User
    Join Date
    01-19-2009
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    29
    Yep, the textbox is called TxtBox

    I've stripped the document of unnecessary things and kept only a button aswell as the userform. Find it attached.
    Attached Files Attached Files

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You've typed the code in from scratch including the initialize. You should select it from the dropdown on the right. It should not be the userform name but

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-19-2009
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    29
    I bow to your wisdom. Maaany thanks!

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    No problem

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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