Thema Datum  Von Nutzer Rating
Antwort
Rot Textbox und ComboBox Addieren
01.11.2015 15:16:34 Ewgenij
NotSolved

Ansicht des Beitrags:
Von:
Ewgenij
Datum:
01.11.2015 15:16:34
Views:
1274
Rating: Antwort:
  Ja
Thema:
Textbox und ComboBox Addieren

Hallo Zusammen

1
2
3
4
5
Ich habe folgendes Problem:
Mein Ziel ist es TextBox3(Geldeingang)durch ComboBox3(Geteilt)zu teilen und in TextBox5(Umsatz)auszugeben.
Also TextBox5 = TextBox4/ComboBox3
 
Habe viel Experimentiert und habe auch nicht wirklich viel Ahnung von Programmiersprachen.

1
2
>Hier die Excel Datei als Link in Dropbox: !!!!!Das ist die Datei wie es aussehen sollte!!!!!

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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
Code:
 
Option Explicit
 
Private Sub ComboBox1_Click()
If ComboBox1.ListIndex <> 0 Then
    TextBox1 = Cells(ComboBox1.ListIndex + 1, 2)
    TextBox2 = Cells(ComboBox1.ListIndex + 1, 3)
    TextBox3 = Cells(ComboBox1.ListIndex + 1, 4)
    TextBox4 = Cells(ComboBox1.ListIndex + 1, 5)
    TextBox5 = Cells(ComboBox1.ListIndex + 1, 6)
    ComboBox2 = Cells(ComboBox1.ListIndex + 1, 7)
    ComboBox3 = Cells(ComboBox1.ListIndex + 1, 8)
    ComboBox4 = Cells(ComboBox1.ListIndex + 1, 9)
    ComboBox5 = Cells(ComboBox1.ListIndex + 1, 10)
    ComboBox6 = Cells(ComboBox1.ListIndex + 1, 11)
Else
    TextBox1 = ""
    TextBox2 = ""
    TextBox3 = ""
    TextBox4 = ""
    TextBox5 = ""
    ComboBox2 = ""
    ComboBox3 = ""
    ComboBox4 = ""
    ComboBox5 = ""
    ComboBox6 = ""
End If
End Sub
 
Private Sub CommandButton1_Click()
If ComboBox1.ListIndex > 0 Then
    Rows(ComboBox1.ListIndex + 1).Delete
    TextBox1 = ""
    TextBox2 = ""
    TextBox3 = ""
    TextBox4 = ""
    TextBox5 = ""
    ComboBox2 = ""
    ComboBox3 = ""
    ComboBox4 = ""
    ComboBox5 = ""
    ComboBox6 = ""
    UserForm_Initialize
End If
End Sub
 
Private Sub CommandButton2_Click()
Dim xZeile As Long
If TextBox1 = "" Then Exit Sub
If ComboBox1.ListIndex = 0 Then
    xZeile = [B65536].End(xlUp).Row + 1
Else
    xZeile = ComboBox1.ListIndex + 1
End If
Cells(xZeile, 2) = TextBox1
Cells(xZeile, 3) = TextBox2
Cells(xZeile, 4) = TextBox3
Cells(xZeile, 5) = TextBox4
Cells(xZeile, 6) = TextBox5
Cells(xZeile, 7) = ComboBox2
Cells(xZeile, 8) = ComboBox3
Cells(xZeile, 9) = ComboBox4
Cells(xZeile, 10) = ComboBox5
Cells(xZeile, 11) = ComboBox6
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
ComboBox2 = ""
ComboBox3 = ""
ComboBox4 = ""
ComboBox5 = ""
ComboBox6 = ""
UserForm_Initialize
End Sub
 
Private Sub CommandButton3_Click()
Unload Me
End Sub
 
 
Private Sub Frame1_Click()
 
End Sub
 
Private Sub Frame4_Click()
 
End Sub
 
Private Sub ListBox1_Click()
 
End Sub
 
Private Sub ListBox3_Click()
 
End Sub
 
Private Sub MultiPage1_Change()
 
End Sub
 
Private Sub TextBox3_Change()
 
End Sub
 
Private Sub UserForm_Initialize()
Dim aRow, i As Variant
Application.EnableEvents = False
ComboBox1.Clear
ComboBox2.Clear
ComboBox3.Clear
ComboBox4.Clear
ComboBox5.Clear
ComboBox6.Clear
aRow = [B65536].End(xlUp).Row
ComboBox1.AddItem "neue Kunde hinzufügen"
With Me.ComboBox2
  .AddItem ""
  .AddItem "12"
  .AddItem "24"
  .AddItem "36"
  .AddItem "48"
  .AddItem "60"
  .ListIndex = "0"
End With
With Me.ComboBox3
  .AddItem ""
  .AddItem "1"
  .AddItem "2"
  .AddItem "3"
  .AddItem "4"
  .AddItem "5"
  .ListIndex = "0"
End With
With Me.ComboBox4
  .AddItem ""
  .AddItem "Ja"
  .AddItem "Nein"
  .ListIndex = "0"
End With
With Me.ComboBox5
  .AddItem ""
  .AddItem "Ja"
  .AddItem "Nein"
  .ListIndex = "0"
End With
With Me.ComboBox6
  .AddItem ""
  .AddItem "Ingo"
  .AddItem "Jemand anderes"
  .ListIndex = "0"
End With
For i = 2 To aRow
    ComboBox1.AddItem Cells(i, 2)
Next i
ComboBox1.ListIndex = 0
ComboBox2.ListIndex = 0
ComboBox3.ListIndex = 0
ComboBox4.ListIndex = 0
ComboBox5.ListIndex = 0
ComboBox6.ListIndex = 0
Application.EnableEvents = True
 
 
ListBox1.ColumnCount = 10
Dim arr
arr = Sheets("Tabelle1").Range("B2:K500000")
ListBox1.List = arr
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
Rot Textbox und ComboBox Addieren
01.11.2015 15:16:34 Ewgenij
NotSolved