+ Reply to Thread
Results 1 to 9 of 9

Userform Initialize (sometimes works, sometimes don't!)

  1. #1
    Forum Contributor
    Join Date
    01-07-2012
    Location
    Bangalore
    MS-Off Ver
    Office 365
    Posts
    367

    Userform Initialize (sometimes works, sometimes don't!)

    Dear Friends,

    I have a userform1 in a workbook which gets visible when user double click on a Range in “Analyzer” Worksheet and while Userform1 appears, it comes with Active cell value in a Textbox1.

    Code in Analyzer Worksheet Module: -


    Please Login or Register  to view this content.
    Code in Userform1 Module: -


    Please Login or Register  to view this content.
    The Problem which I am facing here is, TextBox1 sometime Initialize with active cell value and some times Initialize with blank on it! Can you please review and provide your feedback to fix this issue!

    Thanks & Regards,
    Rajeshkumar R
    Last edited by Rajeshkumar R; 11-18-2017 at 01:59 PM. Reason: Query Resolved

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Userform Initialize (sometimes works, sometimes don't!)

    Try:

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    01-07-2012
    Location
    Bangalore
    MS-Off Ver
    Office 365
    Posts
    367

    Re: Userform Initialize (sometimes works, sometimes don't!)

    Dear mehmetcik,

    When I amend the code as per your suggestion in Userform Module, I am getting Run Time Error 424 in Worksheet Module VBA Code : "UserForm1.Show"

    Am I doing anything wrong?

    Thanks & Regards,
    Rajeshkumar R

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Userform Initialize (sometimes works, sometimes don't!)

    Hi,

    How are you closing the userform? If it is merely hidden and not unloaded, the Initialize event would not fire.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Contributor
    Join Date
    01-07-2012
    Location
    Bangalore
    MS-Off Ver
    Office 365
    Posts
    367

    Re: Userform Initialize (sometimes works, sometimes don't!)

    Dear xlnitwit

    I just use below code to close the Userform!

    Please Login or Register  to view this content.
    Thanks & Regards,
    Rajeshkumar R

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Userform Initialize (sometimes works, sometimes don't!)

    In which form is that code? You are using both unload and Hide but it is not clear if they apply to the same form. If not, you are only hiding Userform1 so the Initialize event will not be triggered by showing it again- you should perhaps use its Activate event instead.

  7. #7
    Forum Contributor
    Join Date
    01-07-2012
    Location
    Bangalore
    MS-Off Ver
    Office 365
    Posts
    367

    Re: Userform Initialize (sometimes works, sometimes don't!)

    Dear xlnitwit ,

    Both Unload & Hide for Userform1 Only!

    Thanks & Regards,
    Rajeshkumar R

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Userform Initialize (sometimes works, sometimes don't!)

    Why are you using both- it makes no sense?

  9. #9
    Forum Contributor
    Join Date
    01-07-2012
    Location
    Bangalore
    MS-Off Ver
    Office 365
    Posts
    367

    Re: Userform Initialize (sometimes works, sometimes don't!)

    Dear xlnitwit ,

    Noted! I just retained Unload me only and it works fine Now!

    Thanks & Regards,
    Rajeshkumar R

+ 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. Userform will not initialize
    By opusarlo in forum Excel General
    Replies: 3
    Last Post: 12-13-2016, 04:21 PM
  2. How to use the UserForm Initialize event to Initialize 3 listboxes in the same userform
    By Pimp_mentality in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-16-2016, 02:59 PM
  3. [SOLVED] Userform initialize (sometimes works, sometimes don't!)
    By pepito_child in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2016, 02:10 AM
  4. Userform - help with initialize
    By Macster in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-23-2009, 05:40 AM
  5. userform initialize
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2006, 06:20 PM
  6. userform initialize
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-04-2006, 05:40 PM
  7. userform initialize
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-04-2006, 05:35 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