+ Reply to Thread
Results 1 to 9 of 9

Refresh userform when opened

  1. #1
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Refresh userform when opened

    In my ongoing efforts to wrap my head around VB, I am in the process of another attempt.

    The code below works to a point. When I first open the workbook, go the sheet "Club Profile" an open the user form it properly displays the name in the text box that is listed in cell AN1 on sheet Club Profile. If I close the form and change the value in cell AN1 (done through a drop down menu on another sheet), and reopen the form the name does not change to the new name in cell AN1. If I close and reopen the workbook the change is shown.

    I need to have the name change when a new name is chosen without closing everything.

    Please Login or Register  to view this content.
    This is the start of my form and I am taking it slow in an attempt to wrap my head around this VBA thing.

    Jim O
    Last edited by JO505; 01-27-2015 at 06:30 PM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Refresh userform when opened

    how are you closing the userform? how are you opening it? Under normal circumstances I would expect you to get the new data if the form is closed and not just hidden away. When it is hidden away it is invisible but open, thus it does not get initialized again when you show it. Can you upload the book containing the form and other macros? You could try putting
    Please Login or Register  to view this content.
    before
    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Refresh userform when opened

    I understand what you are saying.

    The form is opened from a "Button" on the sheet "Club Profile". The code is

    Please Login or Register  to view this content.
    It is closed from a "Button" on the form.

    Please Login or Register  to view this content.
    I have tried a couple of things to no avail so any help is gratefully appreciated.

    The file is quite large so that could be a problem.

    Jim O

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Refresh userform when opened

    Ah, .hide only makes the form hide away, not lose values. Try replacing "ClubProfile.hide" with "unload me" Assuming the CommandButton1 is a button on the form.

  5. #5
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Refresh userform when opened

    That clears the form but I get an error and the first line of the code becomes highlighted in Yellow.

    Please Login or Register  to view this content.
    Jim O

  6. #6
    Forum Contributor
    Join Date
    10-30-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2013
    Posts
    173

    Re: Refresh userform when opened

    Quote Originally Posted by Arkadi View Post
    Ah, .hide only makes the form hide away, not lose values. Try replacing "ClubProfile.hide" with "unload me" Assuming the CommandButton1 is a button on the form.
    The only problem with that is that any other information in the UserForm will be lost.

    If that is a consideration then move the code to the Activate event handler...
    Please Login or Register  to view this content.
    This will work with the OP code.

  7. #7
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Refresh userform when opened

    It seems to be working now. I am sure I will have many more questions. When one starts with no knowledge of this language it is sometimes difficult to fully understand what others are trying to say, it is easy to get lost in the language.

    I appreciate your patience with me and this issue.

    Jim O

  8. #8
    Forum Contributor
    Join Date
    10-30-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2013
    Posts
    173

    Re: Refresh userform when opened

    Quote Originally Posted by JO505 View Post
    It seems to be working now. I am sure I will have many more questions. When one starts with no knowledge of this language it is sometimes difficult to fully understand what others are trying to say, it is easy to get lost in the language.

    I appreciate your patience with me and this issue.

    Jim O
    Hi, other people will search this from time to time so it's good practice if you can pay it forward by posting the actual solution that worked for you.

    Meanwhile, here are some links describing the language...
    This is the reference specific to excel
    And this is the vba reference for all office applications

  9. #9
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Refresh userform when opened

    Thanks for the links, I will check them out.

    Here are the codes I wound up using.

    Please Login or Register  to view this content.
    Again Thanks for your input.

    Jim O

+ 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] Refresh UserForm after entering data in another userform
    By s2jrchoi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-30-2013, 10:34 AM
  2. Alt+Tab not working when an userform is opened
    By sivdin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2009, 06:34 AM
  3. macro to refresh database everytime excel is opened
    By ghynes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2007, 12:22 PM
  4. Userform to load when Workbook is opened
    By Ozgur Pars in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2006, 09:45 AM
  5. Excel does not refresh when opened in IE
    By Innes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2005, 09:06 AM

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