Im creating a catalogue of images which have four versions of each based on 4 different colours. I then have a blank page where the image is inserted based on user entry in another cell for the colour they want. They end up with an image consisting if 4 different images each in different colours.
However it all works, but the problem is that for example if a yellow image is inserted by the user but then chnaged to green, the green image gets inserted in a different location on the page from the yellow although I have cell referenced in the macro as below:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheet2.Pictures.Delete
'rear springs
If Sheet10.Cells(3, 2).Value = "X" Then
ActiveSheet.Shapes("Picture 96").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Range("f9").Select
ActiveSheet.Paste
Sheets("Springs").Select
ElseIf Sheet10.Cells(3, 2).Value = "U" Then
ActiveSheet.Shapes("Picture 97").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Range("f9").Select
ActiveSheet.Paste
Sheets("Springs").Select
End If
Application.ScreenUpdating = True
End Sub
However it all works, but the problem is that for example if a yellow image is inserted by the user but then chnaged to green, the green image gets inserted in a different location on the page from the yellow although I have cell referenced in the macro as below:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheet2.Pictures.Delete
'rear springs
If Sheet10.Cells(3, 2).Value = "X" Then
ActiveSheet.Shapes("Picture 96").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Range("f9").Select
ActiveSheet.Paste
Sheets("Springs").Select
ElseIf Sheet10.Cells(3, 2).Value = "U" Then
ActiveSheet.Shapes("Picture 97").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Range("f9").Select
ActiveSheet.Paste
Sheets("Springs").Select
End If
Application.ScreenUpdating = True
End Sub