1.3k Aufrufe
Gefragt in Tabellenkalkulation von ahorn38 Experte (3.3k Punkte)
Hallo,

ich habe folgenden Code
...
Cells(n - 1, 15).Value = Format(Betrag, "#,##0.00 €")
...
Dieses Format führt aber dazu, dass der Betrag richtig angezeigt wird, allerdings als Textformat erscheint und damit nicht weiter z.B. addiert werden kann. Weiß jemand welches Format mein Problem lösen könnte, also als Währung dargestellt und gleichzeitig weiter berechenbar?
Danke und Gruß
Andreas

5 Antworten

0 Punkte
Beantwortet von m-o Profi (22.9k Punkte)
Hallo Andreas,

in solchen Fällen hilft auch mal der Makro-Rekorder weiter ;-):

Cells(n - 1, 15).NumberFormat = "#,##0.00 $"


Gruß

M.O.
0 Punkte
Beantwortet von ahorn38 Experte (3.3k Punkte)
Hallo M.O.,

danke für den Tipp. Kannst du mir noch sagen, wie ich di Variable "Betrag" da noch unterbringe. Danke!
0 Punkte
Beantwortet von m-o Profi (22.9k Punkte)
Hallo Andreas,

das kannst du z.B. so machen:

With Cells(n - 1, 15)
.Value = Betrag
.NumberFormat = "#,##0.00 $"
End With


Gruß

M.O.
0 Punkte
Beantwortet von ahorn38 Experte (3.3k Punkte)
Hallo,

super, das klappt, so wollte ich das haben. Da wäre ich aber mir dem Macrorekorder sicher nicht hingekommen...?
Gruß
Andreas
0 Punkte
Beantwortet von m-o Profi (22.9k Punkte)
Hallo Andreas,

nein :-). Mir war nicht klar, was du mit
Format(Betrag, "#,##0.00 €")

bezwecken wolltest.

Aber jetzt hast du ja die Lösung.

Gruß

M.O.
...