Hello, I have a quick question. I have 2 cells I would like to use if elseif to set the numberformat in one cell based on a value in another cell. Here is what I have so far, which isnt doing anything for me.
If I just put
LowCB2.Numberformat = "0.00"
LowCB2.Value = "=D9-M9"
in with the rest of the code it works, but if I try to use the if statement neither one of those LowCB2's show up.
Any help would be greatly appreciated
Code:
If Range("J5").Value = "0" Then
Range("LowCB2").NumberFormat = "0"
Range("LowCB2").Value = "=D9-M9"
ElseIf Range("J5").Value = "1" Then
Range("LowCB2").NumberFormat = "0.0"
Range("LowCB2").Value = "=D9-M9"
ElseIf Range("J5").Value = "2" Then
Range("LowCB2").NumberFormat = "0.00"
Range("LowCB2").Value = "=D9-M9"
ElseIf Range("J5").Value = "3" Then
Range("LowCB2").NumberFormat = "0.000"
Range("LowCB2").Value = "=D9-M9"
End If
If I just put
LowCB2.Numberformat = "0.00"
LowCB2.Value = "=D9-M9"
in with the rest of the code it works, but if I try to use the if statement neither one of those LowCB2's show up.
Any help would be greatly appreciated