I need some help with the below code. I have the code working for all the True Statements, but can't quite figure out how to add in the end Statement where if all are not true then the formula at the end of the code needs to be in Range NSOBDate. I don't know if a Select Case would work better for this and if it does, I'm not familiar with Select Case.
Thank you for your Help!
VBA Code:
Sub TestMe()
If Range("NSDate").Value = 30 Then
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date),MONTH(Origination_Date)+1,DAY(Origination_Date))"
End If
If Range("NSDate").Value = 60 Then
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date),MONTH(Origination_Date)+2,DAY(Origination_Date))"
End If
If Range("NSDate").Value = 90 Then
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date),MONTH(Origination_Date)+3,DAY(Origination_Date))"
End If
If Range("NSDate").Value = 120 Then
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date),MONTH(Origination_Date)+4,DAY(Origination_Date))"
End If
If Range("NSDate").Value = 150 Then
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date),MONTH(Origination_Date)+5,DAY(Origination_Date))"
End If
If Range("NSDate").Value = 180 Then
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date),MONTH(Origination_Date)+6,DAY(Origination_Date))"
End If
If Range("NSDate").Value = 270 Then
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date),MONTH(Origination_Date)+9,DAY(Origination_Date))"
End If
If Range("NSDate").Value = 360 Then
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date)+1,MONTH(Origination_Date),DAY(Origination_Date))"
End If
'Need this to be the Formula for NSOBDate if all above are not true
Range("NSOBDate").Formula = _
"=DATE(YEAR(Origination_Date),MONTH(Origination_Date),DAY(Origination_Date)+RC[-3])"
End Sub
Thank you for your Help!