S
Scott
Hello-
I have an if statement that should add a picture to cell A15 based on
the value of E6. When I run the code, the picture for the first IF
statement value always comes up (8-8.24) even though the value of E6
is 9.17. Any ideas?
Thanks-
Scott
Sub PIC()
Dim myCell As Range
Set myCell = Selection
Dim shp1 As Picture
On Error Resume Next
If Range("E6").Value <= "8" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\1.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "8.25" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\2.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "8.5" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\3.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "8.75" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\4.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "9" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\5.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "9.25" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\6.wmf").Select
Selection.Name = "a15 Picture"
End If
myCell.Select
End Sub
I have an if statement that should add a picture to cell A15 based on
the value of E6. When I run the code, the picture for the first IF
statement value always comes up (8-8.24) even though the value of E6
is 9.17. Any ideas?
Thanks-
Scott
Sub PIC()
Dim myCell As Range
Set myCell = Selection
Dim shp1 As Picture
On Error Resume Next
If Range("E6").Value <= "8" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\1.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "8.25" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\2.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "8.5" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\3.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "8.75" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\4.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "9" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\5.wmf").Select
Selection.Name = "a15 Picture"
ElseIf Range("E6").Value <= "9.25" Then
ActiveSheet.Shapes("a15 Picture").Delete
Range("a15").Select
ActiveSheet.Pictures.Insert("M:\custserv\CentreVuReports\Images
\6.wmf").Select
Selection.Name = "a15 Picture"
End If
myCell.Select
End Sub