AW: Hallo, habe Lösung -)
16.08.2008 10:09:00
Erich
Hallo Kurt,
ohne mir den Zusammenhang angeschaut zu haben:
Du verwendest innerhalb einer Addition mehrfach die Format-Funktion.
Was ich verstehe ist, dass du das Ergebnis jeweils formatiert in die Caption schreiben willst.
Dafür reicht aber ein einziger Format-Aufruf für den fertig gerechneten Ausdruck.
Schau dir das mal an:
Sub tst()
Label69.Caption = Format( _
ActiveCell.Offset(0, 24).Value + ActiveCell.Offset(0, 25).Value, "0.00")
Label72.Caption = Format( _
ActiveCell.Offset(0, 16).Value, "0.00") 'Kulanzspalte
Label80.Caption = Format( _
ActiveCell.Offset(0, 43), "0.00") 'zusatzboni vom Text
Label84.Caption = Format( _
ActiveCell.Offset(0, 24).Value + _
ActiveCell.Offset(0, 25).Value + _
ActiveCell.Offset(0, 43).Value, "0.00")
Label74.Caption = Format( _
Label84.Caption - Label72.Caption, "0.00")
End Sub
' oder kürzer und übersichtlicher
Sub tst2()
With ActiveCell
Label69.Caption = Format(.Offset(, 24) + .Offset(, 25), "0.00")
Label72.Caption = Format(.Offset(, 16), "0.00") 'Kulanzspalte
Label80.Caption = Format(.Offset(, 43), "0.00") 'zusatzboni vom Text
Label84.Caption = Format(.Offset(, 24) + .Offset(, 25) + .Offset(, 43), "0.00")
Label74.Caption = Format(Label84.Caption - Label72.Caption, "0.00")
End With
End Sub
Rückmeldung wäre nett! - Grüße von Erich aus Kamp-Lintfort - Schönes Wochenende!