Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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\CentreVuR eports\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\CentreVuR eports\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\CentreVuR eports\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\CentreVuR eports\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\CentreVuR eports\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\CentreVuR eports\Images \6.wmf").Select Selection.Name = "a15 Picture" End If myCell.Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change Picture based on cell value | Excel Worksheet Functions | |||
Insert picture based on cell value (unlimited) | Excel Programming | |||
Inserting picture into excel based on # in the another cell | Excel Worksheet Functions | |||
How to add picture based on a cell value | Excel Discussion (Misc queries) | |||
how do I show a picture in excel based on cell data | Excel Discussion (Misc queries) |