I am exploring this code below, which chandoo has posted:
Sub move_Image()
Dim left As Integer
Dim top As Integer
'Define the position values
left = Range("Left").Value
top = Range("Top").Value
'Select the shape and position it
ActiveSheet.Shapes("Rounded Rectangle 1").Select
Selection.ShapeRange.top = top
Selection.ShapeRange.left = left
End Sub
==========================================================
When I hit the F8 to run the code line by line, when it comes to this line:
left = Range("Left").Value
It shows a message box indicating run time error 1104, Method 'Range" of Object _ Global' failed, and when I keep the mouse over the line, it says:
Range("Left").Value = " Method 'Range' of the object_ 'Global' failed "
How can I fix this error? Or what do I need to add to these lines to make the code run.
I appreciate your help.
Guity
Sub move_Image()
Dim left As Integer
Dim top As Integer
'Define the position values
left = Range("Left").Value
top = Range("Top").Value
'Select the shape and position it
ActiveSheet.Shapes("Rounded Rectangle 1").Select
Selection.ShapeRange.top = top
Selection.ShapeRange.left = left
End Sub
==========================================================
When I hit the F8 to run the code line by line, when it comes to this line:
left = Range("Left").Value
It shows a message box indicating run time error 1104, Method 'Range" of Object _ Global' failed, and when I keep the mouse over the line, it says:
Range("Left").Value = " Method 'Range' of the object_ 'Global' failed "
How can I fix this error? Or what do I need to add to these lines to make the code run.
I appreciate your help.
Guity