+ Reply to Thread
Results 1 to 3 of 3

Global code to center user forms

  1. #1
    Registered User
    Join Date
    10-13-2011
    Location
    Jozi, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    93

    Global code to center user forms

    I have the following code which centers user forms on their screen, i have this in every module (with a different form name of course), but would like to simlyfy it into a global module and just call it from each form when it initialises.

    Please Login or Register  to view this content.
    I was thinking something along the lines of storing the form name as a varaible (strFrmName) and then using code as such :

    Please Login or Register  to view this content.
    But its not working. I have also tried the below with no luck. Icannot find anythin online about this either:

    Please Login or Register  to view this content.
    ***------ Coding for Fun ------***

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Global code to center user forms

    userform Initialize event
    Please Login or Register  to view this content.
    in a standard module
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-13-2011
    Location
    Jozi, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Global code to center user forms

    Thanks, works a treat.

+ 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 for multiple User Forms
    By Guido Meng in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-06-2013, 08:06 PM
  2. user forms code, etc
    By jhi3600 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-10-2011, 02:28 AM
  3. Global variables & forms
    By opopanax666 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2010, 07:21 AM
  4. Macro Code for User Forms
    By heidilu in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-12-2010, 06:24 AM
  5. VBA Code and User Forms.
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2010, 01:13 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