gmedalla999
New Member
- Joined
- Apr 23, 2016
- Messages
- 8
Hello all,
I am very new to the forum and very new with the use of Macro as well. I wish to be able to move an object to a certain cell (using .top and .left). It is important the location be referenced to the cell versus increment or numerical value. Below is the sample of my code but I could not make it work. Cell I1 is the input cell where I will type which cell the object will go to, i.e. Cell J10? I would greatly appreciate any help I could get. thanks
Sub ShiftShape()
Dim oShape As Shape
Set oShape = ActiveSheet.Shapes("Flowchart: Decision 3")
Dim oCell As Range
Set oCell = ActiveSheet.Range("I1").Value
'the value of Range("I1) will be a text saying which cell the shape will go to.
oShape.Top = oCell.Top
oShape.Left = oCell.Left
End Sub
I am very new to the forum and very new with the use of Macro as well. I wish to be able to move an object to a certain cell (using .top and .left). It is important the location be referenced to the cell versus increment or numerical value. Below is the sample of my code but I could not make it work. Cell I1 is the input cell where I will type which cell the object will go to, i.e. Cell J10? I would greatly appreciate any help I could get. thanks
Sub ShiftShape()
Dim oShape As Shape
Set oShape = ActiveSheet.Shapes("Flowchart: Decision 3")
Dim oCell As Range
Set oCell = ActiveSheet.Range("I1").Value
'the value of Range("I1) will be a text saying which cell the shape will go to.
oShape.Top = oCell.Top
oShape.Left = oCell.Left
End Sub