+ Reply to Thread
Results 1 to 5 of 5

VBA IF Mac form size increases when a new form is opened

  1. #1
    Registered User
    Join Date
    02-11-2016
    Location
    Wisconsin
    MS-Off Ver
    07-360
    Posts
    53

    VBA IF Mac form size increases when a new form is opened

    Hi, I am running the following code on user forms in a workbook that is used by both Macs and PCs as mac users said the forms were too small.
    Please Login or Register  to view this content.
    The issue I am having is that this user form (primary) also has other user forms (secondary) that can be opened from it. When this occurs and the secondary form closes, the primary for will scale up again, getting ever larger as secondary forms are used. I believe the issue may be that when the secondary form is closed, the primary will refresh itself and then scale up because the width and height were changed the last time it was brought up. Is there a way I can work around this? I have already tried coding in the size of the form so that it read:
    Please Login or Register  to view this content.
    This caused some issues with how controls on the form appeard so I stopped using it.

    I also have some zoom buttons which I highly doubt are the issue but thought I would add the code just in case:
    Please Login or Register  to view this content.
    Thanks for your help!
    Last edited by mnadamn19; 11-17-2016 at 03:33 AM.

  2. #2
    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: VBA IF Mac form size increases when a new form is opened

    Hi,

    Which event is that code in?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    02-11-2016
    Location
    Wisconsin
    MS-Off Ver
    07-360
    Posts
    53

    Re: VBA IF Mac form size increases when a new form is opened

    I can't believe I missed that with the copy. Sorry it is userform_activate(). I have edited the original post to reflect that.

  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: VBA IF Mac form size increases when a new form is opened

    That would explain the increasing size - each time you switch back to the form you reactivate it. You might try loading the Height and Width into module level variables in the Initialize event, and then in the Activate event, only resize if the form dimensions are the same as the initial ones.

    Or set a form level Boolean variable to True in the activate event after resizing the form and check it at the start of the activate event before resizing again. So at the top of the form module
    Please Login or Register  to view this content.
    then the Activate event needs to read
    Please Login or Register  to view this content.
    Last edited by xlnitwit; 11-17-2016 at 04:07 AM.

  5. #5
    Registered User
    Join Date
    02-11-2016
    Location
    Wisconsin
    MS-Off Ver
    07-360
    Posts
    53

    Re: VBA IF Mac form size increases when a new form is opened

    Thanks, that did the trick!

+ 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. code to create unique alphanumeric form number every time form is opened
    By Ishwarind in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2014, 06:16 AM
  2. Same form opened multiple times
    By alsega in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2012, 10:31 AM
  3. Print preview from user form opened from a user form
    By Brunstgnegg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2011, 05:12 AM
  4. Filling form fields via worksheet dropdowns, user update via form, change form color
    By Demosthenes&Locke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2010, 08:58 AM
  5. Increase form control maximum as data increases
    By okriskao in forum Excel General
    Replies: 1
    Last Post: 01-13-2009, 09:44 AM
  6. Can a user form be opened from a macro??
    By mike703 in forum Excel General
    Replies: 1
    Last Post: 07-06-2006, 04:30 PM
  7. [SOLVED] how can I make a form number change everytime the form is opened
    By babydumplingspita in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-10-2005, 03:05 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