+ Reply to Thread
Results 1 to 4 of 4

How to access/manipulate Top, Left, Bottom, & Width properties of FORM controls

  1. #1
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    How to access/manipulate Top, Left, Bottom, & Width properties of FORM controls

    Wrote the following to capture the default state 'location' properties of all Active X controls in workbook and pass to an array. I would like to expand this functionallity to do the exact same thing for Form Controls. Any assistance or insight is greatly appreciated!

    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to access/manipulate Top, Left, Bottom, & Width properties of FORM controls

    loop through the shapes and check if the type is msoformcontrol
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: How to access/manipulate Top, Left, Bottom, & Width properties of FORM controls

    Perfect. Thanks as always, JP.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to access/manipulate Top, Left, Bottom, & Width properties of FORM controls

    you're welcome. just remember that a data validation dropdown will also be part of the shapes collection and you don't want to start manipulating those! simple test is
    is its type msoformcontrol, then is its formcontroltype xldropdown, and if so does its topleftcell property error.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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