Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm writing an application where users will move around several objects (Label fields) on a worksheet 1. How can I make the objects "snap" to the cell borders ? 2. Is it possible to "link" two or more objets (on different worksheets) so that all "linked" objects are moved simultaneously if one of them is moved? Thanks a lot for any ideas or suggestions ! Ed |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Snapping" is accomplished by adjusting an object's Top and Left properties
to those of the underlying cell: Dim x As Shape Set x = Sheet1.Shapes(1) x.Left = x.TopLeftCell.Left 'etc No way to link the moving of objects. You'd have to write a macro to do that. -- Jim "Ed Schwartz" wrote in message ... | | I'm writing an application where users will move around several | objects (Label fields) on a worksheet | | 1. How can I make the objects "snap" to the cell borders ? | 2. Is it possible to "link" two or more objets (on different worksheets) | so that all "linked" objects are moved simultaneously if one of them | is moved? | | Thanks a lot for any ideas or suggestions ! | | Ed | |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks a lot, Jim - works very well ! Dim x As Shape Set x = Sheet1.Shapes(1) x.Left = x.TopLeftCell.Left 'etc No way to link the moving of objects. You'd have to write a macro to do that. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 1. How can I make the objects "snap" to the cell borders ? On Excel's Drawing toolbar, click Draw Snap To Grid. 2. Is it possible to "link" two or more objets (on different worksheets) so that all "linked" objects are moved simultaneously if one of them is moved? If the shapes on sheet1 and sheet2 were given the same names on both sheets, you could use the following code to update their positions. 'In Sheet1's code module Private Sub Worksheet_Activate() Dim shp As Shape For Each shp In Sheets("Sheet1").Shapes shp.Top = Sheets("Sheet2").Shapes(shp.Name).Top shp.Left = Sheets("Sheet2").Shapes(shp.Name).Left Next End Sub 'In sheet2's code module Private Sub Worksheet_Activate() Dim shp As Shape For Each shp In Sheets("Sheet2").Shapes shp.Top = Sheets("Sheet1").Shapes(shp.Name).Top shp.Left = Sheets("Sheet1").Shapes(shp.Name).Left Next End Sub Regards, Vic Eldridge |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ActiveX Command Button - Snap to Cell Boundaries | Excel Discussion (Misc queries) | |||
Excel object in word document; some cell borders are too dark | Excel Discussion (Misc queries) | |||
Snap an object to a cell border via macro | Excel Discussion (Misc queries) | |||
Borders Object | Excel Programming | |||
snap to from vba | Excel Programming |