Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Single
Application.ScreenUpdating = False
Range("D:D").NumberFormat = "General"
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(i, 3) < 0 Then
Cells(i, 4) = WorksheetFunction.Round(Cells(i, 1), Cells(i, 3))
Else
If Cells(i, 1) <> "" And Cells(i, 3) <> "" Then
Cells(i, 4).NumberFormat = "0." & String(Cells(i, 3), "0")
Cells(i, 4).Value = Round(Cells(i, 1), Cells(i, 3))
End If
End If
Next i
Application.ScreenUpdating = True
End Sub