Snap Object to cell borders
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
|