Thanks SPV, I'm trying to go in your direction. The only thing is as a function I'm not trying to have a value returned, is it possible to do this and just change the cells as I need, my code so far is as follows:
Function DeratingCoefficient()
' This handles the derating factor for degrees of 60 C
If Cells(2, 4) = 60 Then
If Cells(3, 4) = "21-25" Then
Cells(2, 7) = 1.08
ElseIf Cells(3, 4) = "26-30" Then
Cells(2, 7) = 1#
ElseIf Cells(3, 4) = "31-35" Then
Cells(2, 7) = 0.91
ElseIf Cells(3, 4) = "36-40" Then
Cells(2, 7) = 0.82
ElseIf Cells(3, 4) = "41-45" Then
Cells(2, 7) = 0.71
ElseIf Cells(3, 4) = "46-50" Then
Cells(2, 7) = 0.58
ElseIf Cells(3, 4) = "51-55" Then
Cells(2, 7) = 0.41
ElseIf Cells(3, 4) = "56-60" Then
Cells(2, 7) = "---"
ElseIf Cells(3, 4) = "61-70" Then
Cells(2, 7) = "---"
ElseIf Cells(3, 4) = "71-80" Then
Cells(2, 7) = "---"
End If
' This handles the derating factor for degrees of 75 C
ElseIf Cells(2, 4) = 75 Then
If Cells(3, 4) = "21-25" Then
Cells(2, 7) = 1.05
ElseIf Cells(3, 4) = "26-30" Then
Cells(2, 7) = 1#
ElseIf Cells(3, 4) = "31-35" Then
Cells(2, 7) = 0.94
ElseIf Cells(3, 4) = "36-40" Then
Cells(2, 7) = 0.88
ElseIf Cells(3, 4) = "41-45" Then
Cells(2, 7) = 0.82
ElseIf Cells(3, 4) = "46-50" Then
Cells(2, 7) = 0.75
ElseIf Cells(3, 4) = "51-55" Then
Cells(2, 7) = 0.67
ElseIf Cells(3, 4) = "56-60" Then
Cells(2, 7) = 0.58
ElseIf Cells(3, 4) = "61-70" Then
Cells(2, 7) = 0.33
ElseIf Cells(3, 4) = "71-80" Then
Cells(2, 7) = "---"
End If
' This handles the derating factor for degrees of 90 C
ElseIf Cells(2, 4) = 90 Then
If Cells(3, 4) = "21-25" Then
Cells(2, 7) = 1.04
ElseIf Cells(3, 4) = "26-30" Then
Cells(2, 7) = 1#
ElseIf Cells(3, 4) = "31-35" Then
Cells(2, 7) = 0.96
ElseIf Cells(3, 4) = "36-40" Then
Cells(2, 7) = 0.91
ElseIf Cells(3, 4) = "41-45" Then
Cells(2, 7) = 0.87
ElseIf Cells(3, 4) = "46-50" Then
Cells(2, 7) = 0.82
ElseIf Cells(3, 4) = "51-55" Then
Cells(2, 7) = 0.76
ElseIf Cells(3, 4) = "56-60" Then
Cells(2, 7) = 0.71
ElseIf Cells(3, 4) = "61-70" Then
Cells(2, 7) = 0.58
ElseIf Cells(3, 4) = "71-80" Then
Cells(2, 7) = 0.41
End If
End If
End Function