Private
Sub
cmd_VSave_Click()
Dim
iRow
As
Long
If
Lst_Vrmtr.ListIndex = -1
Then
Exit
Sub
If
Trim(
CStr
(txt_VName.Text)) =
""
Then
MsgBox
"Bitte trage einen Namen ein!"
, vbCritical + vbOKOnly,
"Fehler!"
Exit
Sub
End
If
iRow = 2
Dim
Newname
As
String
Do
While
Trim(
CStr
(WksVrmtr.Cells(iRow, 1).Value)) <>
""
If
Lst_Vrmtr.List(Lst_Vrmtr.ListIndex, 0) = Trim(
CStr
(WksVrmtr.Cells(iRow, 1).Value))
Then
With
WksVrmtr
.Cells(iRow, 3).Value = cmb_VAnrede.Value
.Cells(iRow, 4).Value = txt_VHandyA.Value
.Cells(iRow, 5).Value = txt_VHandyB.Value
.Cells(iRow, 6).Value = txt_VFestnetz.Value
.Cells(iRow, 7).Value = txt_VFax.Value
.Cells(iRow, 8).Value = txt_VMail.Value
.Cells(iRow, 9).Value = txt_VHomepage.Value
.Cells(iRow, 10).Value = txt_VAnmerkung.Value
.Cells(iRow, 2).Value = txt_VName.Value
End
With
Exit
Do
End
If
iRow = iRow + 1
Loop
End
Sub
---------------------------------------------------------------------------------
Private
Sub
Lst_Vrmtr_Click()
Dim
VTxtRow
As
Long
Dim
i
As
Long
Dim
strVrmtr
As
String
If
Lst_Vrmtr.ListIndex >= 0
Then
VTxtRow = 2
i = 0
Dim
singleselect
As
Boolean
singleselect =
False
Do
While
Trim(
CStr
(WksVrmtr.Cells(VTxtRow, 1).Value)) <>
""
If
Lst_Vrmtr.List(Lst_Vrmtr.ListIndex, 0) = Trim(
CStr
(WksVrmtr.Cells(VTxtRow, 1).Value))
Then
txt_VID = WksVrmtr.Cells(VTxtRow, 1).Value
txt_VName = WksVrmtr.Cells(VTxtRow, 2).Value
txt_VHandyA = WksVrmtr.Cells(VTxtRow, 4).Value
txt_VHandyB = WksVrmtr.Cells(VTxtRow, 5).Value
txt_VFestnetz = WksVrmtr.Cells(VTxtRow, 6).Value
txt_VFax = WksVrmtr.Cells(VTxtRow, 7).Value
txt_VMail = WksVrmtr.Cells(VTxtRow, 8).Value
txt_VHomepage = WksVrmtr.Cells(VTxtRow, 9).Value
txt_VAnmerkung = WksVrmtr.Cells(VTxtRow, 10).Value
cmb_VAnrede = WksVrmtr.Cells(VTxtRow, 3).Value
Exit
Do
End
If
VTxtRow = VTxtRow + 1
Loop
End
If
End
Sub