I have coded a certain format in VBA but when the macro is run I get a number with 13 numbers to the right of the decimal point. Is there a way of resolving this? I have highlighted in red the offending line
Code:
Columns("K").Select
With Selection
.NumberFormat = "0.00"
.Columns.Autofit
.VerticalAlignment = xlCenter
.HorizontalAlignment = xlRight
End With
For R2 = 4 To LR
Retrace1 = 0.03
Retrace2 = Retrace1 * 100
BUY = (Range("H" & R2) * Retrace1)
BUY1 = Range("H" & R2) + BUY
BUY2 = Range("D" & R2)
BUY3 = BUY2 - Range("J" & R2)
Range("J1").Value = Retrace2 & "% Retracement"
If BUY < BUY2 Then Range("J" & R2).Value = BUY1
If BUY1 < BUY2 Then Range("I" & R2).Value = BUY1
[Red] Range("K" & R2).Value = ("Buy at " & BUY3 & " or less")[/Red]
Next R2