Exel

  sms 14:19 05 Feb 07
Locked

I have a picture in exel and would like to be able to move it to certain positions on the page depending upon another cell value.
is this possible to do.

thanks in advance

  VoG II 14:34 05 Feb 07

Assuming that you want the picture to move when you enter a value in a particular cell then right click the sheet tab, select View code and paste in

Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address(False, False) <> "A1" Then Exit Sub
With ActiveSheet.DrawingObjects("Picture 1")
If Target.Value < 10 Then
.Left = 10
.Top = 10
Else
.Left = 100
.Top = 50
End If
End With
End Sub

This will move Picture 1 when the value in A1 changes from <10 to >=10. Change A1 and Picture 1 to suit. You can see the name of the picture if you click on it and look in the Address box.

  sms 15:04 05 Feb 07

Thanks for the quick response. Works just fine

This thread is now locked and can not be replied to.

Surface Pro (2017) vs Surface Pro 4

20 groundbreaking 3D animation techniques

How to mine Bitcoin on Mac