#####userform1(kunde suchen)
Private
Sub
CommandButton1_Click()
Dim
x
As
String
Dim
y
As
String
Z = Sheets(1).UsedRange.Rows.Count
x = TextBox1
y = TextBox2
temp = 0
For
i = 4
To
Z
If
Cells(i, 5) = x
And
Cells(i, 6) = y
Then
temp = 1
Exit
For
End
If
Next
If
temp = 1
Then
Unload
Me
zeile = i
KundeVerwalten.Show
Else
MsgBox
"Kunde nicht vorhanden!"
, vbExclamation
TextBox1 =
""
End
If
End
Sub
Private
Sub
CommandButton2_Click()
Unload
Me
End
Sub
####userform2(veränderter Kunde speichern und löschen):
Private
Sub
CommandButton1_Click()
temp = MsgBox(
"Soll der Kunde wirklich gelöscht werden?"
, vbYesNo)
If
temp = vbYes
Then
Sheets(1).Rows(zeile).Delete
Unload
Me
End
If
End
Sub
Private
Sub
CommandButton2_Click()
Sheets(1).Cells(zeile, 2) = TextBox1
Sheets(1).Cells(zeile, 3) = TextBox2
Sheets(1).Cells(zeile, 4) = TextBox4
Sheets(1).Cells(zeile, 5) = TextBox5
Sheets(1).Cells(zeile, 6) = TextBox6
Sheets(1).Cells(zeile, 7) = TextBox7
Sheets(1).Cells(zeile, 8) = TextBox8
Sheets(1).Cells(zeile, 9) = TextBox9
Sheets(1).Cells(zeile, 10) = TextBox10
Sheets(1).Cells(zeile, 11) = TextBox11.Value
Sheets(1).Cells(zeile, 12) = TextBox12
Sheets(1).Cells(zeile, 13) = TextBox13
Sheets(1).Cells(zeile, 14) = TextBox14
Sheets(1).Cells(zeile, 15) = TextBox15
Sheets(1).Cells(zeile, 16) = TextBox16
Sheets(1).Cells(zeile, 17) = TextBox17
Sheets(1).Cells(zeile, 18) = TextBox18
Sheets(1).Cells(zeile, 19) = TextBox19
Sheets(1).Cells(zeile, 20) = TextBox20
Sheets(1).Cells(zeile, 21) = TextBox21
Sheets(1).Cells(zeile, 22) = TextBox22
Sheets(1).Cells(zeile, 23) = TextBox23
Unload
Me
End
Sub
Private
Sub
CommandButton3_Click()
Unload
Me
End
Sub
Private
Sub
UserForm_Initialize()
TextBox1 = Cells(zeile, 2)
TextBox2 = Cells(zeile, 3)
TextBox4 = Cells(zeile, 4)
TextBox5 = Cells(zeile, 5)
TextBox6 = Cells(zeile, 6)
TextBox7 = Cells(zeile, 7)
TextBox8 = Cells(zeile, 8)
TextBox9 = Cells(zeile, 9)
TextBox10 = Cells(zeile, 10)
TextBox11 = Cells(zeile, 11)
TextBox12 = Cells(zeile, 12)
TextBox13 = Cells(zeile, 13)
TextBox14 = Cells(zeile, 14)
TextBox15 = Cells(zeile, 15)
TextBox16 = Cells(zeile, 16)
TextBox17 = Cells(zeile, 17)
TextBox18 = Cells(zeile, 18)
TextBox19 = Cells(zeile, 19)
TextBox20 = Cells(zeile, 20)
TextBox21 = Cells(zeile, 21)
TextBox22 = Cells(zeile, 22)
TextBox23 = Cells(zeile, 23)
End
Sub
MfG
Armin