jamie.gill
New Member
- Joined
- Jan 28, 2011
- Messages
- 30
how to automaticly round a cell to the nearest 100 upon input.
Is there a macro code for this??
Is there a macro code for this??
Private Sub Worksheet_Change(ByVal Target As Range)
If IsNumeric(Target.Value) Then
Application.EnableEvents = False
Target.Value = WorksheetFunction.Round(Target.Value, -2)
Application.EnableEvents = True
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:A7")) Is Nothing Then Exit Sub
If IsNumeric(Target.Value) Then
Application.EnableEvents = False
Target.Value = WorksheetFunction.Round(Target.Value, -2)
Application.EnableEvents = True
End If
End Sub
Thank you this was a great helpTry
Code:Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A1:A7")) Is Nothing Then Exit Sub If IsNumeric(Target.Value) Then Application.EnableEvents = False Target.Value = WorksheetFunction.Round(Target.Value, -2) Application.EnableEvents = True End If End Sub