Type Missmatch
ing.grohn
Luc würde sagen das hatten wier schon ...... Stimmt.
Trotzdem:
in einer Userform werden etliche Textboxen aufsummiert. Die Werte werden mit Format(Textbox.Value,"#0.00") in die Boxen geschrieben. Anschließend läuft eine Schleife 12 mal:
mit
UfK.Controls("Textbox" & 326 + I).Value = Format(Val(WorksheetFunction.Substitute _
(UfK.Controls(" Textbox" & 27 + I).Value, ",", ".")) _
+ Val(WorksheetFunction.Substitute(UfK.Controls("Textbox" & 53 + I).Value, ",", ".")) _
+ Val(WorksheetFunction.Substitute(UfK.Controls("Textbox" & 66 + I).Value, ",", ".")) _
+ Val(WorksheetFunction.Substitute(UfK.Controls("Textbox" & 92 + I).Value, ",", ".")) _
+ Val(WorksheetFunction.Substitute(UfK.Controls("Textbox" & 144 + I).Value, ",", ".")) _
+ Val(WorksheetFunction.Substitute(UfK.Controls("Textbox" & 196 + I).Value, ",", ".")) _
+ Val(WorksheetFunction.Substitute(UfK.Controls("Textbox" & 248 + I).Value, ",", ".")), "#0.00")
gehts. Mit der folgenden Variante
UfK.Controls("Textbox" & 326 + I).Value = Format(CDec(UfK.Controls("Textbox" & 27 + I).Value) _
_
+ CDec(UfK.Controls("Textbox" & 53 + I).Value) _
+ CDec(UfK.Controls("Textbox" & 66 + I).Value) _
+ CDec(UfK.Controls("Textbox" & 92 + I).Value) _
+ CDec(UfK.Controls("Textbox" & 144 + I).Value) _
+ CDec(UfK.Controls("Textbox" & 196 + I).Value) _
+ CDec(UfK.Controls("Textbox" & 248 + I).Value), "#0. 00")
gibs Type missmatch!
Warum?
kann mir jemand auf die Sprünge helfen?
Mit freundlichen Grüßen
Albrecht