ausgangspunkt ist das makro von Sigi.E in diesem thread.
https://www.herber.de/forum/archiv/264to268/t264128.htm
habe es jetzt so abgewandelt, dass es als sub()funktioniert.
Sub FormatSpezial()
Dim Auswahl As Range
Dim Zelle As Variant
Set Auswahl = Application.Selection
For Each Zelle In Auswahl
If Zelle.Value = Int(Zelle.Value) Then
Zelle.NumberFormat = "#,##0"",--"""" Fr"""
Else
Zelle.NumberFormat = "#,##0.00"" Fr"""
End If
Next Zelle
End Sub
wird der CODE aber einem WORKSHEET_CHANGE zugewiesen, ergibt die eingabe von 1 (1,-- Fr) bei 1,5 (2,-- Fr).
wie gesagt das sub funzzt. wo ist der unterschied ??
gruss thomas