online 1
gast (50)

/ Forum / Tabellenkalkulation

TabellenkalkulationTabellenkalkulation

Fragevon Meikel vom 21.06.2019, 15:54 Options

Wert aus Formel wird nicht in Userform in angezeigt.

Hallo zusammen,

ich würde mich sehr freuen, wenn ich nochmals Eure Hilfe in Anspruch nehmen dürfte.

Ich habe eine UserForm erstellt, die beim Doppelklick in eine Zelle den Datensatz anzeigen soll. Der Wert aus beiliegender Formel wir aber nicht angezeigt. Die Textbox bleibt leer.

Die Formel lautet:

txtTextBox1.Text = Format(Evaluate("=" & txtTextBox2 & "+" & txtTextBox3 & "+0" & txtTextBox4), "0.00")

Hat vielleicht jemand eine Idee, was damit nicht stimmt?

Besten Dank vorab für die Unterstützung

Gruß, meikel


Antwort schreiben

Antwort 1 von Hajo_Zi vom 21.06.2019, 17:29 Options

Hallo meikel,

Textboxen enthalten das was der Name sagt Text. Du verkettest Text und willst dem ein Format zuweisen ds geht nicht und außer dem hast Du zu beginn ein "="
Dein Code würde ergeben z. =123456799. Dem Ausdruck kannst u kein Format zuweisen.

Gruß Hajo

Antwort 2 von Meikel vom 21.06.2019, 18:18 Options

Hi Hajo,

danke für die Info.

Was müßte ich denn machen, um einen berechneten Wert in der UserForm anzeigen zu können?

Hast Du vielleicht einen Tipp für mich.

Danke vorab und viele Grüße, meikel

Antwort 3 von Hajo_Zi vom 21.06.2019, 18:45 Options

Halo Meikel,

txtTextBox1.Text = Format(Cdbl( txtTextBox2)+cdbl( txtTextBox3) + cdbl( txtTextBox4), "0.00")

ich hoffe mal ich habe keine Klammer vergessen.

Gruß Hajo

Antwort 4 von Meikel vom 21.06.2019, 19:06 Options

Hallo Hajo,

passt, wunderbar !!!!

Hab' (leider) noch eine 2. Formel:

Basis wäre Deine Formel, s.u.

txtTextBox1.Text = Format(Cdbl( txtTextBox2)+cdbl( txtTextBox3) + cdbl( txtTextBox4), "0.00")

Nach TextBox4, das ganze, also (2+3+4)*TextBox5(%)+TextBox6

Könntest Du mir bitte diese Formel auch noch anpassen.

Es würde mich sehr freuen und wäre die Krönung meiner Applikation.

Tausend Dank vorab, Gruß meikel

Antwort 5 von Hajo_Zi vom 21.06.2019, 19:18 Options

Hallo Meikel,

das ist doch nun einfache Formelarbeit

Format()Cdbl( txtTextBox2)+cdbl( txtTextBox3) + cdbl( txtTextBox4))*cdbl(Textbox5)/100+Cdbl(Textbox6), "0.00")

Ich gehe mal davon aus das für 10% 10 in der Textbox5 steht.

Gruß Hajo

Antwort 6 von Meikel vom 21.06.2019, 19:42 Options

Hallo Hajo,

erstmal danke. Einfach Formelarbeit, hatte ich auch gedacht.

In Textbox5 steht der Wert als 5,0%


Hab' die Formel wie folgt eingefügt (funktioniert leider nicht)
txtTextBox1.Text = Format()CDbl(txtTextBox2 + CDbl(txtTextBox3) + CDbl(txtTextBox4)) * CDbl(txtTextBox5) / 100 + CDbl(txtTextBox6), "0.00")

Könntest Du das bitte nochmal überprüfen.

Danke vielmals vorab, Gruß meikel

Antwort 7 von Hajo_Zi vom 21.06.2019, 19:44 Options

Hallo Meikel

Format()Cdbl( txtTextBox2)+cdbl( txtTextBox3) + cdbl( txtTextBox4))*cdbl(Mid(Textbox5,len(textbox5)-1))/100+Cdbl(Textbox6), "0.00")

Gruß Hajo

Antwort 8 von Meikel vom 21.06.2019, 20:25 Options

Hallo Hajo,

klappt leider noch immer nicht.

Habe den Code so übernommen:
txtTextBox1.Text = Format((CDbl(txtTextBox2) + CDbl(txtTextBox3) + CDbl(txtTextBox4))* CDbl((Mid(txtTextBox5,Len(txtTextBox5)-1) / 100) + CDbl(txtTextBox6), "0.00")

Hab die Klammer nach Fornat von () in (( geändert, sonst wäre der Code rot. Es wird auch kein Fehler mehr angezeigt. Hab nochmal die Eigenschaften der Textbox kontrolliert, ist auch ok.

Wert wird einfach nicht angezeigt !

Hast Du noch eine Idee woran es liegen könnte ?

Gruß, meikel

Antwort 9 von Hajo_Zi vom 21.06.2019, 20:37 Options

Hallo Meikel,

bei so komplizierten Problemen ist eine Beispieldatei nicht schlecht, dann braucht man es nicht nachbauen. Auf die Eigenschaft ".Rext" kann verzichtet werden.

Option Explicit

Sub Meikel()
Dim txtTextBox1 As String
Dim txtTextBox2 As String
Dim txtTextBox3 As String
Dim txtTextBox4 As String
Dim txtTextBox5 As String
Dim txtTextBox6 As String
txtTextBox2 = "13"
txtTextBox3 = "14"
txtTextBox4 = "15"
txtTextBox5 = "10%"
txtTextBox6 = "3"
txtTextBox1 = Format((CDbl(txtTextBox2) + CDbl(txtTextBox3) + CDbl(txtTextBox4)) * _
CDbl(Left(txtTextBox5, Len(txtTextBox5) - 1)) / 100 + CDbl(txtTextBox6), "0.00")
End Sub

Gruß Hajo

Antwort 10 von Meikel vom 21.06.2019, 21:07 Options

Hallo Hajo,

wir sind fast da. Der Wert wird schon mal angezeigt. Aber irgendwie ist da noch einen Dreher drin:

TextBox1: 4,95
TextBox2: 0,12
TextBox3: 0,00
TextBox4: 0,15
TextBox5: 10%
TextBox6: 5,73 = Ergebnis (angezeigt wird nur die Differenz 0,66)

Bedeutet:

txtTextBox6= Format((CDbl(txtTextBox1) + CDbl(txtTextBox2) + CDbl(txtTextBox3)) * _
CDbl(Left(txtTextBox5, Len(txtTextBox5 - 1)) / 100 + CDbl(txtTextBox4), "0.00")

Sorry, das ich mich so blöd anstelle. Meine Konzentration ist leider nicht mehr auf dem Höhepunkt.

Was mach ich falsch??? Herzlichen Dank für Deine Hilfe.

Gruß, meikel

Antwort 11 von Meikel vom 21.06.2019, 21:20 Options

Hallo Hajo,

ich hab's

Die 2. Formel enthält das Ergebnis der ersten Formel ohne die Prozentrechnung.
D.h. Ich hab das Ergebnis aus der ersten Formel (Antwort 3) der 2. Formel zugeordnet durch Addition hinzugefügt.

Jetzt passt es!!

Vielen herzlichen Dank für Deine Bemühungen und Geduld.
Auch diesmal konnte das Forum durch seine Experten wieder zum Erfolg beitragen.

Danke und schönen Abend, Gruß meikel

Ähnliche Themen

Formel wird als Formel und nicht der errechnete Wert angezeigt!
Wittemann  17.01.2007 - 240 Hits - 4 Antworten

excel kleinsten posivsten wert anzeigen
jouejoue  13.03.2007 - 66 Hits - 6 Antworten

Wert negativ anzeigen
la.cm  05.04.2007 - 94 Hits - 4 Antworten

Formel funktioniert nur bedingt
Meikel  08.05.2007 - 83 Hits - 3 Antworten

Bei Bestimmten Wert der Zelle soll Userform aufgehen
Bischoff2000  22.04.2008 - 44 Hits - 1 Antwort

Hinweis

Diese Frage ist schon etwas älter, Sie können daher nicht mehr auf sie antworten. Sollte Ihre Frage noch nicht gelöst sein, stellen Sie einfach eine neue Frage im Forum..

Neue Einträge

Version: supportware 1.9.150 / 10.06.2022, Startzeit:Sun Jan 25 18:15:21 2026