I manually named the Indicator icons since there was only a handful. That way I could refer to them
Option Explicit
Dim wsIcon As Worksheet, wsData As Worksheet
Sub InsertIcons()
Dim rData As Range, rCell As Range
Dim shpIcon As Shape
'setup
Set wsIcon = ThisWorkbook.Worksheets("INDICATORS")
Set wsData = ThisWorkbook.Worksheets("MONTHLY")
Application.ScreenUpdating = False
'delete old shapes
For Each shpIcon In wsData.Shapes
If shpIcon.Type <> msoChart Then shpIcon.Delete
Next
'effeciency
Set rData = wsData.Range("A8").CurrentRegion
For Each rCell In rData.Columns(3).Cells
If rCell.Value >= 0.9 Then
Call PasteIcon("EFF1", rCell)
ElseIf rCell.Value >= 0.89 Then
Call PasteIcon("EFF2", rCell)
ElseIf rCell.Value >= 0.86 Then
Call PasteIcon("EFF3", rCell)
ElseIf rCell.Value >= 0.83 Then
Call PasteIcon("EFF4", rCell)
ElseIf rCell.Value >= 0.8 Then
Call PasteIcon("EFF5", rCell)
Else
Call PasteIcon("EFF6", rCell)
End If
Next
'AQL fail
Set rData = wsData.Range("E8").CurrentRegion
For Each rCell In rData.Columns(3).Cells
If rCell.Value >= 0.1 Then
Call PasteIcon("QUAL4", rCell)
ElseIf rCell.Value >= 0.08 Then
Call PasteIcon("QUAL3", rCell)
ElseIf rCell.Value >= 0.06 Then
Call PasteIcon("QUAL2", rCell)
Else
Call PasteIcon("QUAL1", rCell)
End If
Next
'Rejects
'I don't see what the rules are
Application.CutCopyMode = False
Application.ScreenUpdating = False
End Sub
Private Sub PasteIcon(IconName As String, DestCell As Range)
wsIcon.Shapes(IconName).Copy
DestCell.Offset(0, 1).Select
wsData.Paste
With Selection
.Height = DestCell.Offset(0, 1).Height
.Width = DestCell.Offset(0, 1).Width
End With
Application.CutCopyMode = False
End Sub