Can anyone help me with setting up and adding shapes to groups depending on their position on the worksheet. They are all pasted dynamically and regularly deleted and recreated, so usign their ID or name is difficult. They are a mixture of textboxes, arrows and pictures.
Hopefully the below code snippet will let you see what I'm trying to do
Sub groupshapes()
Dim myshape As Object
' groups:
' 1 2 3
' 4 5 6
Group = 0
For Each Object In ActiveSheet
Select Case Object.Left
Case 0 To Range("P1").Left: Group = 1
Case Range("Q1").Left To Range("AF1").Left: Group = 2
Case Range("AH1").Left To Range("AV1").Left: Group = 3
End Select
If Object.Top > Range("A27").Left Then Group = Group + 3
'Add object to relevant group - no idea how :)
Next
End Sub
Bookmarks