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

Inputbox

Forumthread: Inputbox

Inputbox
03.11.2007 19:18:55
Peter
Hallo wertes Forum
Ich habe ein kleines Tool geschrieben für eine Berechnung. Es funktioniert auch. Aber jetzt benötige ich Hilfe. Wenn ich CommandButton2 clicke startet die Berechnung. Aber Textbox12 wird oft vergessen zu befüllen und dann startet das Makro nicht.
meine Idee wäre eine wenn dann Abfrage und mit Hilfe der Inputbox kann dann der Wert für die Textbox12 eingetragen werden und das Makro läuft weiter
Hier der Berechungsteil und ein Link zur Testversion

Private Sub CommandButton2_Click()
If TextBox1  "" And ComboBox1  "" And ComboBox9  "" And TextBox4  "" Then TextBox6. _
Value = CCur(TextBox1) * CCur(ComboBox1) * CCur(ComboBox9) * CCur(TextBox4) / 100
If TextBox6  "" Then TextBox8.Value = CCur(TextBox6)
Dim c As Long, d As Long
c = CCur(TextBox8)
TextBox6 = TextBox8
If ComboBox8  "" Then TextBox9.Value = CCur(TextBox5) + CCur(TextBox8) - CCur(TextBox7)
If ComboBox8  "" Then TextBox11.Value = CCur(TextBox9) * (CCur(TextBox12) / 100)
If ComboBox8  "" Then TextBox10.Value = CCur(TextBox3)
If ComboBox8  "" Then Label18.Caption = CCur(TextBox11) + CCur(TextBox10)
End Sub


https://www.herber.de/bbs/user/47368.xls
Danke für die Hilfe im Voraus
Gruß Peter Knierim

Anzeige

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
nicht getestet
03.11.2007 19:26:00
Matthias
Hallo
Versuche mal statt:
If ComboBox8 "" Then TextBox11.Value = CCur(TextBox9) * (CCur(TextBox12) / 100)
If ComboBox8 "" Then TextBox11.Value = CCur(TextBox9) * CCur((TextBox12) / 100)
Userbild

Anzeige
AW: Inputbox
03.11.2007 19:49:45
Thomas
Hallo Peter,
Du kannst doch vor Ausführung des Makros überprüfen ob die Textbox12 ausgefüllt wurde, wenn nicht kommt ein Hinweis. z.B. so:
If TextBox12 = "" Then MsgBox "Textbox12 nicht ausgefüllt!": TextBox12.SetFocus: Exit Sub
Gruß Thomas

AW: Inputbox
03.11.2007 20:10:51
Peter
Danke das war die Lösung
Gruß Peter
Anzeige
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige