You can use a user defined function.
Public Function udfROTATE_SHAPE(Value, Name)
Dim shpTemp As Shape
On Error GoTo Err
Set shpTemp = ActiveSheet.Shapes(Name)
shpTemp.Rotation = Value
udfROTATE_SHAPE = True
Exit Function
Err:
If shpTemp Is Nothing Then
udfROTATE_SHAPE = CVErr(xlErrName)
Else
udfROTATE_SHAPE = CVErr(xlErrValue)
End If
Exit Function
End Function
called from cell using formula. This assumes scrollbar is linked to cell G1 and the shape is called 'Oval 1'
=udfROTATE_SHAPE(G1,"Oval 1")
Bookmarks