Private
Sub
CommandButtonSuchen_Click()
Dim
c
As
Range
Dim
i
As
Long
Dim
strSuche
As
String
strSuche = TextBoxSuchen.Value
With
Worksheets(
"Übersicht Kompanie"
)
Set
c = .Rows(2).Find(strSuche, LookIn:=xlValues, LookAt:=xlWhole)
If
Not
c
Is
Nothing
Then
For
i = 1
To
34
Controls(
"Textbox"
& i).Value = .Cells(i + 2, c.Column).Value
Next
End
If
End
With
End
Sub
Private
Sub
CommandButtonÄndern_Click()
Dim
c
As
Range
Dim
i
As
Long
Dim
strSuche
As
String
strSuche = TextBoxSuchen.Value
With
Worksheets(
"Übersicht Kompanie"
)
Set
c = .Rows(2).Find(strSuche, LookIn:=xlValues, LookAt:=xlWhole)
If
Not
c
Is
Nothing
Then
For
i = 1
To
34
.Cells(i + 2, c.Column) = Controls(
"Textbox"
& i).Value
Next
End
If
End
With
End
Sub