Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Warum wirkt der Formatbefehl nicht?

Forumthread: Warum wirkt der Formatbefehl nicht?

Warum wirkt der Formatbefehl nicht?
14.05.2004 09:16:31
Heinz
Hallo Excelfreunde,
ich habe für einen Workshop nachstehendes Makro geschrieben.
Warum wirkt sich der Formatbefehl nicht aus? wenn ich in der Deklaration das "As Single" weglasse, funktioniert es!

Sub EuroRechner()
Const Titel = "EURO-Umrechner - EUR <=> ATS"
Const msg_Eingabe = "Geben Sie den Betrag ein!"
Const msg_Result1 = "Betrag in ATS: "
Const msg_Result2 = "Betrag in EUR: "
Const Kurs = 13.7603
Dim nEingabe As Single
Dim nFremdWg As Single
Dim msg_Result$
nEingabe = Format(Val(InputBox(msg_Eingabe, Titel)), "#,##0.00")
If MsgBox("Sind das EURO?", vbYesNo, "EUR oder ATS?") = vbYes Then
nFremdWg = Format(nEingabe * Kurs, "#,##0.00")
msg_Result = msg_Result2 & nEingabe & vbCrLf & msg_Result1 & nFremdWg
Else
nFremdWg = Format(nEingabe / Kurs, "#,##0.00")
msg_Result = msg_Result1 & nEingabe & vbCrLf & msg_Result2 & nFremdWg
End If
MsgBox msg_Result, vbInformation, Titel
End Sub

Danke
Heinz
Anzeige

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Re: weil Format String erzeugt... (oT)
Hans
Gruß HW
AW: Re: weil Format String erzeugt... (oT)
14.05.2004 10:54:19
Heinz
Hallo Hans,
na klar, danke vielmals!
Heinz
Anzeige
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige