+ Reply to Thread
Results 1 to 5 of 5

Userform to remember selection when Workbook is closed & re-opened

  1. #1
    Forum Contributor
    Join Date
    01-04-2016
    Location
    Newcastle
    MS-Off Ver
    2016
    Posts
    107

    Post Userform to remember selection when Workbook is closed & re-opened

    My Userform currently is used to apply auto filters to other sheets.

    However, if I applied the filters, then close down excel, the userform will rese,t so I can't see what criteria I have filtered to.

    Currently when closing the just the userform I've applied this code:

    Please Login or Register  to view this content.
    Which simply hides the Userform, when i attempt to close it, therefore when I open the Userform again i will be presented with my current filters.

    But obviously if i exit out of excel my Userform resets.

    I've attached an example spreadsheet
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-04-2016
    Location
    Newcastle
    MS-Off Ver
    2016
    Posts
    107

    Re: Userform to remember selection when Workbook is closed & re-opened

    ----Bump----

  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Userform to remember selection when Workbook is closed & re-opened

    As you're aware, data in userform controls does not persist so the next time the userform is loaded all controls will be reset to the design time default.

    The usual thing to do is to save current entries to a hidden worksheet when the userform is unloaded and read that on load. In your simplistic example you'd only need to save the contents of the textbox as that can also be used to select the listbox items as well.

  4. #4
    Forum Contributor
    Join Date
    01-04-2016
    Location
    Newcastle
    MS-Off Ver
    2016
    Posts
    107

    Re: Userform to remember selection when Workbook is closed & re-opened

    Thanks, i thought there wouldn't be a super solution, appreciate the respone

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    26,128

    Re: Userform to remember selection when Workbook is closed & re-opened

    Quote Originally Posted by cytop View Post
    The usual thing to do is to save current entries to a hidden worksheet when the userform is unloaded and read that on load.
    You may already know this, but to take action the first time the form is loaded use

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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] Need help! - Copy From Closed to Opened Workbook as Values
    By Ariff_Chowdhury in forum Excel Programming / VBA / Macros
    Replies: 41
    Last Post: 05-28-2015, 02:52 PM
  2. Replies: 1
    Last Post: 09-26-2014, 09:21 AM
  3. [SOLVED] VBA to copy cell from opened or closed workbook into another workbook
    By megtoma in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2014, 04:22 PM
  4. [SOLVED] Copy a Worksheet from a Closed Workbook to the Current Opened Workbook
    By glennchung in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-28-2014, 12:55 PM
  5. [SOLVED] copy entire sheet from closed workbook and insert into another workboook when opened
    By tombie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-03-2013, 03:26 AM
  6. copy a range from 2 closed workbooks to opened workbook
    By ahsanzafar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2012, 08:40 PM
  7. Replies: 1
    Last Post: 11-26-2011, 09:10 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