Hi Moshe,
Try this
Option Explicit
Sub Test()
'first format some cells in #,##0.00 format
'then make a selection & run this sub
server Selection
End Sub
Function server(r As Range)
'I've added message boxes so you
'can see what's happening here
Dim cell As Range
Dim i As Integer
For Each cell In Selection
If cell.NumberFormat = "#,##0.00" Then
i = cell.Value + 1
MsgBox i
Else
i = server '< maybe you mean this?
MsgBox i
Exit Function
'i = server '< does nothing here
End If
Next
End Function
HTH,
John