+ Reply to Thread
Results 1 to 7 of 7

Match the display of a userform on laptop or desktop.

  1. #1
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Match the display of a userform on laptop or desktop.

    If I create a VBA userform on my laptop, then put it on a desktop, often I have to make major changes so that it displays correctly.

    Is there somewhere I can set something that will force the userform to display correctly on either machine?

  2. #2
    Registered User
    Join Date
    08-27-2019
    Location
    Alabama, USA
    MS-Off Ver
    365, 2016, 2010, 2007
    Posts
    57

    Re: Match the display of a userform on laptop or desktop.

    You could define it as a percentage, I'm still learning myself, but something along these lines:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-27-2019
    Location
    Alabama, USA
    MS-Off Ver
    365, 2016, 2010, 2007
    Posts
    57

    Re: Match the display of a userform on laptop or desktop.

    After posting my weak attempt at this problem I did a search for possible solutions and found one that works on my 32bit machine, and resizes to what I input, but I do not have another 32bit machine I can try it on(and it did NOT work on my 64 bit machines), it seems promising though.

    Please Login or Register  to view this content.
    That code was found at LINK written by user "gn00588950".

  4. #4
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Re: Match the display of a userform on laptop or desktop.

    That looks like it might work, once I establish the percentage required.

    I was thinking that if the resolution got changed, then the percentage would also have to change.

    I was hoping that the may be a way of standardising it, so if the resolution went up or down the userform would remain the same size. This would mean the userform would always need to be a ratio of the display screen, no matter what resolution or zoom.

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Match the display of a userform on laptop or desktop.

    Quote Originally Posted by kjg View Post
    If I create a VBA userform on my laptop, then put it on a desktop, often I have to make major changes so that it displays correctly.

    Is there somewhere I can set something that will force the userform to display correctly on either machine?
    I copy a module to each project I have forms in then call
    Please Login or Register  to view this content.
    from the Form initialize event. (The first argument is the form itself, the other 2 are self explanatory)

    I cant recall all of the places I pulled this code together from over years so if anybody wants to claim credit, please notify me and I will add an acknowledgement.

    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  6. #6
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    198

    Re: Match the display of a userform on laptop or desktop.

    Thank you for you help Spencer, we have 64 bit machines so I will be looking at mc84excel's solution.

    mc84excel, again thank you for your solution. It looks very complex to me, but as we use a lot of forms it will be well worth the effort trying to learn it.

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Match the display of a userform on laptop or desktop.

    Quote Originally Posted by kjg View Post
    Thank you for you help Spencer, we have 64 bit machines so I will be looking at mc84excel's solution.

    mc84excel, again thank you for your solution. It looks very complex to me, but as we use a lot of forms it will be well worth the effort trying to learn it.
    Thanks for the rep kjg.

    Re complexity = In that there is a lot of code or you need assistance using?
    If the former - the code will contain several functions that are not relevant to your request (e.g. ArrowKeysChangeSelectedItemInFormListBox). I removed some that weren't of interest but didn't have time/effort to find and remove all! (I use these modules as reusable code. I export them so I can then drag/drop the template into any VBA project whenever I need any of the functions in that template module)

    Also I should warn you that this code hasn't been tested for 64 bit compatibility (I prefer to install Excel as 32 bit). Only the 'GetSystemMetrics' API has been finished. Can anybody provide 64 bit compatible versions for the other APIs?

+ 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. macro performance is differing Personal Laptop vs Virtual dual desktop at office
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2018, 07:54 PM
  2. Asset management programe (For Desktop ,Laptop and other part)
    By sambha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2014, 12:41 AM
  3. Date Formatting Changes Between Laptop and Desktop - Why?
    By Oleschool in forum Excel General
    Replies: 6
    Last Post: 12-06-2012, 01:34 AM
  4. Can I move Excel 2002 from my laptop to my desktop
    By X_Drive in forum Excel General
    Replies: 1
    Last Post: 12-30-2005, 04:10 PM
  5. [SOLVED] Save as not working for laptop to desktop
    By Adra in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-29-2005, 06:06 PM
  6. How do i set up my desktop computer to work from my laptop
    By juliek in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-26-2005, 12:54 PM
  7. Replies: 0
    Last Post: 01-31-2005, 03: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