Hi all,
I've got a grouped shape that will move based on the cell value entered in cell A1.
Now I want this grouped shaped to always move 5 columns to the left.
So when I enter value M8 in cell A1 VBA should automatically move the grouped shape to H8 (at least that is the upper left corner of the grouped shape.)
I've tried using offset but I guess i'm using a wrong syntax. Can anyone help me out?
So far this is my code:
Public Sub Move_shape()
Dim oShape As Shape
Set oShape = ActiveSheet.Shapes("Group 7")
Dim oCell As Range
Set oCell = Range(Range("A1").Value)
'the value of Range("A1) will be a text saying which cell the shape will go to.
oShape.Top = oCell.Top
oShape.Left = oCell.Left
End Sub
Thanks Remco
I've got a grouped shape that will move based on the cell value entered in cell A1.
Now I want this grouped shaped to always move 5 columns to the left.
So when I enter value M8 in cell A1 VBA should automatically move the grouped shape to H8 (at least that is the upper left corner of the grouped shape.)
I've tried using offset but I guess i'm using a wrong syntax. Can anyone help me out?
So far this is my code:
Public Sub Move_shape()
Dim oShape As Shape
Set oShape = ActiveSheet.Shapes("Group 7")
Dim oCell As Range
Set oCell = Range(Range("A1").Value)
'the value of Range("A1) will be a text saying which cell the shape will go to.
oShape.Top = oCell.Top
oShape.Left = oCell.Left
End Sub
Thanks Remco