Thema Datum  Von Nutzer Rating
Antwort
30.11.2019 19:24:02 Chrimaet
NotSolved
30.11.2019 22:40:30 Gast7777
NotSolved
01.12.2019 10:13:32 tscharl
****
NotSolved
01.12.2019 14:25:09 Gast48487
NotSolved
01.12.2019 14:29:18 Chrimaet
NotSolved
01.12.2019 15:05:25 tscharl
NotSolved
01.12.2019 15:13:11 tscharl
NotSolved
01.12.2019 15:13:13 tscharl
NotSolved
01.12.2019 16:47:18 Chrimaet
NotSolved
01.12.2019 16:38:08 Chrimaet
NotSolved
Rot Addieren von Textboxen wenn Wert <2 ist
01.12.2019 20:22:25 tscharl
*****
NotSolved
01.12.2019 21:31:05 Chrimaet
NotSolved
01.12.2019 21:51:44 Chrimaet
NotSolved
01.12.2019 22:43:33 tscharl
Solved
01.12.2019 22:51:19 tscharl
NotSolved
02.12.2019 00:24:29 Chrimaet
NotSolved
02.12.2019 08:13:33 tscharl
NotSolved
07.12.2019 16:16:27 Chrimaet
NotSolved
07.12.2019 16:28:51 tscharl
NotSolved
07.12.2019 16:47:53 Chrimaet
NotSolved
07.12.2019 16:55:12 tscharl
NotSolved
07.12.2019 17:18:58 Chrimaet
NotSolved
07.12.2019 21:58:58 Gast45422
NotSolved
07.12.2019 22:00:08 tscharl
NotSolved
07.12.2019 22:32:30 Chrimaet
NotSolved
07.12.2019 23:12:33 tscharl
NotSolved
08.12.2019 00:23:30 Chrimaet
NotSolved

Ansicht des Beitrags:
Von:
tscharl
Datum:
01.12.2019 20:22:25
Views:
839
Rating: Antwort:
  Ja
Thema:
Addieren von Textboxen wenn Wert <2 ist

Habe noch ein wenig probiert.

es folgt der Code für 4 Bahnen.

 

##########################################################

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Option Explicit
Dim strWeiterSo As String
Dim strFehler As String
Dim strHinweis As String
 
 
Private Sub UserForm_Initialize()
    strWeiterSo = "Mach weiter so, dann schaffst du die Bahnen unter 18."
    strFehler = "Du hast nur 6 Schläge!"
    strHinweis = "Bitte gültigen Wert eingeben."
    Dim n As Integer
    For n = 1 To 4
        Me.Controls("Bahn" & n).Value = "?"
    Next n
    Textbox1.Value = 0
    Textbox2.Value = 0
    Textbox3.Value = 0
End Sub
 
Private Sub Berechne()
    Dim n As Integer
    Textbox1.Value = 0
    Textbox2.Value = 0
    Textbox3.Value = 0
    For n = 1 To 4
        If Me.Controls("Bahn" & n).Value = 1 Then
            Textbox1.Value = Textbox1.Value + 1
        End If
        If Me.Controls("Bahn" & n).Value > 2 And IsNumeric(Me.Controls("Bahn" & n).Text) Then
            Textbox2.Value = Textbox2.Value + Me.Controls("Bahn" & n).Value - 2
        End If
        If IsNumeric(Me.Controls("Bahn" & n)) Then
            Textbox3.Value = Textbox3.Value + Val(Me.Controls("Bahn" & n).Text)
        End If
    Next n
End Sub
 
 
Private Sub Bahn1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    Dim varWert As Variant
    If IsNumeric(Bahn1.Value) Then
        varWert = Bahn1.Value
    Else
        MsgBox strHinweis
        Cancel = True
        Exit Sub
    End If
    If varWert > 7 Then
        MsgBox strFehler
        Cancel = True
        Exit Sub
    End If
    If varWert = 0 Then
        MsgBox strWeiterSo
    End If
    Call Berechne
End Sub
 
Private Sub Bahn2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    Dim varWert As Variant
    If IsNumeric(Bahn2.Value) Then
        varWert = Bahn2.Value
    Else
        MsgBox strHinweis
        Cancel = True
        Exit Sub
    End If
    If varWert > 7 Then
        MsgBox strFehler
        Cancel = True
        Exit Sub
    End If
    If varWert = 0 Then
        MsgBox strWeiterSo
    End If
    Call Berechne
End Sub
 
Private Sub Bahn3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    Dim varWert As Variant
    If IsNumeric(Bahn3.Value) Then
        varWert = Bahn3.Value
    Else
        MsgBox strHinweis
        Cancel = True
        Exit Sub
    End If
    If varWert > 7 Then
        MsgBox strFehler
        Cancel = True
        Exit Sub
    End If
    If varWert = 0 Then
        MsgBox strWeiterSo
    End If
    Call Berechne
End Sub
 
Private Sub Bahn4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    Dim varWert As Variant
    If IsNumeric(Bahn4.Value) Then
        varWert = Bahn4.Value
    Else
        MsgBox strHinweis
        Cancel = True
        Exit Sub
    End If
    If varWert > 7 Then
        MsgBox strFehler
        Cancel = True
        Exit Sub
    End If
    If varWert = 0 Then
        MsgBox strWeiterSo
    End If
    Call Berechne
End Sub

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
30.11.2019 19:24:02 Chrimaet
NotSolved
30.11.2019 22:40:30 Gast7777
NotSolved
01.12.2019 10:13:32 tscharl
****
NotSolved
01.12.2019 14:25:09 Gast48487
NotSolved
01.12.2019 14:29:18 Chrimaet
NotSolved
01.12.2019 15:05:25 tscharl
NotSolved
01.12.2019 15:13:11 tscharl
NotSolved
01.12.2019 15:13:13 tscharl
NotSolved
01.12.2019 16:47:18 Chrimaet
NotSolved
01.12.2019 16:38:08 Chrimaet
NotSolved
Rot Addieren von Textboxen wenn Wert <2 ist
01.12.2019 20:22:25 tscharl
*****
NotSolved
01.12.2019 21:31:05 Chrimaet
NotSolved
01.12.2019 21:51:44 Chrimaet
NotSolved
01.12.2019 22:43:33 tscharl
Solved
01.12.2019 22:51:19 tscharl
NotSolved
02.12.2019 00:24:29 Chrimaet
NotSolved
02.12.2019 08:13:33 tscharl
NotSolved
07.12.2019 16:16:27 Chrimaet
NotSolved
07.12.2019 16:28:51 tscharl
NotSolved
07.12.2019 16:47:53 Chrimaet
NotSolved
07.12.2019 16:55:12 tscharl
NotSolved
07.12.2019 17:18:58 Chrimaet
NotSolved
07.12.2019 21:58:58 Gast45422
NotSolved
07.12.2019 22:00:08 tscharl
NotSolved
07.12.2019 22:32:30 Chrimaet
NotSolved
07.12.2019 23:12:33 tscharl
NotSolved
08.12.2019 00:23:30 Chrimaet
NotSolved