Textboxen ohne Format addieren
01.03.2004 14:09:00
Lars
Habe wieder mal ein Problem(chen). Suf meiner Userform befinden sich mehrere Textboxen, die sich aufeinander beziehen. Lese beim Start einige Infos in die textboxes ein und weise Ihnen (zahlen-) Formate zu. Schaut dann so aus und funktioniert auch tadellos:
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem ("Full Retail")
.AddItem ("Lite Retail / Bulk")
.AddItem ("No Import costs")
End With
If TextBox11.Value = "" Then
ComboBox1.Text = "Full Retail"
With ComboBox2
.AddItem ("Full Retail")
.AddItem ("Lite Retail / Bulk")
.AddItem ("No Import costs")
End With
If TextBox18.Value = "" Then
ComboBox2.Text = "Full Retail"
With TextBox1
.Value = Format(Sheets("#Wechselkurs#").Cells(7, 3), "##0.000")
End With
With TextBox2
.Value = Format((1 / TextBox1.Value), "##0.000")
End With
With TextBox3
.Value = "5"
End With
With TextBox4
.Value = "12"
End With
End Sub
Private Sub textbox6_change()
With TextBox6
.Value = Format(TextBox6.Value, "$##0.00")
End With
With TextBox8
.Value = Format(TextBox8.Value, "##0.00")
End With
With TextBox9
.Value = Format((TextBox8.Value / TextBox7.Value) , "$##0.00")
End With
With TextBox10
.Value = Val(TextBox6.Value) + Val(TextBox9.Value)
End With
End Sub
Code eingefügt mit Syntaxhighlighter 2.5
wie zu sehen ist bei diesem Change Ereignis, versuche ich die Werte aus Textbox 6 und 9 miteinander zu addieren, dies klappt aber nicht. Ich vermute das es an dem ausgewiesenem Format (mit Dollarzeichen) liegt. Kann man die Textboxen auch ohne dem Format auslesen und miteinander addieren ???
Danke für evtl. Tipps schon mal im Voraus !!!
Lars.