dcsimg
Results 1 to 3 of 3

Thread: VBA using lose focus

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2019
    Posts
    2

    VBA using lose focus

    I have an excel vba userform that I've set up to be always on top. there's 2 things I'd like to accomplish that I can't figure out how.
    1) minimize the Excel window while the userform is active
    2) when the userfom loses focus (another application has focus) my userform resizes (In effect I want it to mimic a ribbon)
    Possible? Not Possible???
    Last edited by Rominall; Jul 18th, 2019 at 03:52 PM.

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2019
    Posts
    2

    Re: VBA using lose focus

    I figured out #1 but still stuck on 2.

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,441

    Re: VBA using lose focus

    there is no excel built in event to fire when the userform or excel lose focus, but it would probably be possible using APIs
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width