Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Userforms with a memory

    When using the Data Analysis tools of the Analysis Toolpak Add-in, I realized that all forms have a kind of memory, e.g. when performing one of these tools a second time, the previous settings and entries are still there. How can this be done? Is this Good Programming Practice? What about computer memory, speed, etc.?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userforms with a memory

    Hans,

    When a userform is created, you can hide it rather than closing it. It's more efficient if the form is likely to be needed again, as there's a lot less work to be done the next time.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userforms with a memory

    Thanks, I didn't realize that it was all it needed. I understand the benefits of it, but do you have an idea of the memory and system resources it takes? I am always using the UserForm1.Show command to make a form visible and loaded and when I don't need it anymore, I am using
    UserForm1.UnLoad
    Set UserForm1 = Nothing
    Is this overkill?

  4. #4
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userforms with a memory

    Hans,

    I've no idea of the resources. I'm going just by what I've been taught right from VB lesson 1.

    You might be able to experiment yourself to see the there's a noticable difference between unload and hide- even putting into a loop (with the userform autohiding/autoclosing).

    It may well be there's not noticable performance difference anyway.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •