Results 1 to 8 of 8
  1. #1
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Aligning Controls on Forms (2002)

    I used the Forms Toolbar to create four Command Buttons that execute macros. Everything works great, but I'd like to align the Command Buttons in some accurate way, either to each other, to a cell border, or whatever.

    The Forms Toolbar has a "Toggle Grid" control, but I can't see that it does anything. Nor do I find it mentioned in the Help.

    Any suggestions?
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Aligning Controls on Forms (2002)

    Select your command buttons and from the Drawing Toolbar select Allign or Distribute, and you can allign your controls horizontally and/or vertically in relation to each other.

    Andrew C

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Aligning Controls on Forms (2002)

    Andrew has already answered your question. In addition, you can have the edges of the command buttons snap to the nearest cell borders by keeping the Alt key down while moving or resizing the buttons.

  4. #4
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: Aligning Controls on Forms (2002)

    I can now do what I want. Thanks once again for all your help.

    Now... what's the Grid on the Forms Toolbar for? Also, "nudging" seems to work erratically. Maybe the two questions are related.
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Aligning Controls on Forms (2002)

    The forms toolbar controls can also be added to a dialog sheet (Excel 95 and older had no userforms, but dialog sheets). The grid button only snaps controls to the grid of the dialog sheet. You can add a dialog sheet by ricghtclicking a sheet tab and choosing insert. Then select the dialog sheet.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Aligning Controls on Forms (2002)

    Added to what Jan advised about the Grid, it does act (on a regular worksheet) as a toggle to display/hide cell gridlines.

    On the Drawing toolbar there is a Snap to Grid toggle, and this may be causing some confusion. When the toggle is on the nudge operations should align your shapes to the gridlines (cell margins) of the sheet, eg. if you select nudge left, the selected shape should be aligned with the left margin of the nearest cell, or if the shape is aligned with the margin of a cell, then it should align with the left margin of the next leftmost cell. Nudge Right aligns with the right margins and similarly Nudge Up and Down align with the Top/Bottom margins of the cell(s).

    If Snap to Grid is off, the nudge operations just move the selected shapes bt by small increments in the appropriate direction.

    Using gthe cursor keys has the same effect as the nudge operations of the Drawing menu, and the behaviour also depends on the Snap to Grid toggle setting.

    Hope this clarifies.

    Andrew C

  7. #7
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: Aligning Controls on Forms (2002)

    Aha! So it's the WORKSHEET grid, is it?

    In the worksheet region I've been working on, each cell has borders on all four sides. No WONDER I didn't see anything going on when I toggled the Forms Toolbar's grid. Also, no wonder that, when I looked outside my bordered area, I saw no gridlines at all! I was wondering how on earth I could have accidentally opened Tools > Options and changed it!

    Now I'll revisit nudging, and see if I've got (with your help) it figured out.
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Aligning Controls on Forms (2002)

    <hr>Added to what Jan advised about the Grid, it does act (on a regular worksheet) as a toggle to display/hide cell gridlines.
    <hr>

    Neat, didn't know that.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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