Ken
Try this;
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim TheRg As Range
Dim TheRgCells
Dim IsInteger As Boolean
Dim InRg
Dim Denom As Integer
Denom = Range("V6").Value 'Set denominator here
Set TheRg = Range("C9:C17")
Set InRg = Application.Intersect(Target, TheRg)
If Not (InRg Is Nothing) Then
For Each TheRgCells In TheRg
'Check if Integer
IsInteger = IIf(TheRgCells <> 0, (Int(TheRgCells) - TheRgCells) = 0, False)
If IsInteger Then
'If TheRgCells = Denom the handle view here
If TheRgCells = Denom Then
TheRgCells.NumberFormat = "?" & "/" & Denom
Else
TheRgCells.NumberFormat = TheRgCells & "/" & Denom
End If
'Stop recursion due to change
Application.EnableEvents = False
TheRgCells.Formula = "=" & TheRgCells & "/" & Denom 'Range("V6")
Else
If Not (TheRgCells.HasFormula) Then TheRgCells.NumberFormat = "General"
End If
Application.EnableEvents = True
Next
End If
End Sub
Ivan