-
Add this code to the worksheet module
[VBA]
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Fmla As String
Application.EnableEvents = False
If Target.Cells.Count > 1 Then Exit Sub
If Not Target.HasFormula Then
Target = Application.Round(Target * 4, 0) / 4
Else
Fmla = Application.Substitute(Target.Formula, "=", "")
Target.Formula = "=ROUND(4*(" & Fmla & "),0)/4"
End If
Application.EnableEvents = True
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules