Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

z = Range("A2:AP1000").Find(what:=....Falsch

Forumthread: z = Range("A2:AP1000").Find(what:=....Falsch

z = Range("A2:AP1000").Find(what:=....Falsch
04.08.2005 12:50:54
Peter
Hallo liebe Helfer,
mit nachstehendem Code möchte ich Daten die auf einer Userform in die entsprechenden TextBoxen eingegeben werden überspeichern. Die Daten sollen in dei Zeile geschrieben werden wo die Übereinstimmung des Inhaltes von TextBox1 (=Kunden-Nr) steht. Das Eigenartige ist dass es meistens klappt, aber hin und wieder schreibt er die Daten auch in die falsche Zeile....Wer kann da helfen?

Private Sub cmdButton1_Click()
Dim z As Integer, myArr As Variant
Application.ScreenUpdating = False
If TextBox1 = "" Then
ComboBox1.SetFocus
Exit Sub
End If
Sheets("finanzdaten").Activate
z = Range("A2:AP1000").Find(what:=TextBox1).Row
Cells(z, 1) = TextBox1.Value
Cells(z, 2) = TextBox2.Value
Cells(z, 3) = TextBox3.Value
Cells(z, 4) = TextBox4.Value
Cells(z, 5) = TextBox5.Value
Cells(z, 6) = TextBox6.Value
Cells(z, 7) = TextBox7.Value
Cells(z, 8) = TextBox8.Value
Cells(z, 9) = TextBox9.Value
Cells(z, 10) = TextBox10.Value
Cells(z, 11) = TextBox11.Value
Cells(z, 12) = TextBox12.Value
Cells(z, 13) = TextBox13.Value
Cells(z, 14) = TextBox14.Value
Cells(z, 15) = TextBox15.Value
Cells(z, 16) = TextBox16.Value
Cells(z, 17) = TextBox17.Value
Cells(z, 18) = TextBox18.Value
Cells(z, 19) = TextBox19.Value
Cells(z, 20) = TextBox20.Value
Cells(z, 21) = TextBox21.Value
Cells(z, 22) = TextBox22.Value
Cells(z, 23) = TextBox23.Value
Cells(z, 24) = TextBox24.Value
Cells(z, 25) = TextBox25.Value
Cells(z, 26) = TextBox26.Value
Cells(z, 27) = TextBox27.Value
Cells(z, 28) = TextBox28.Value
Cells(z, 29) = TextBox29.Value
Cells(z, 30) = TextBox30.Value
Cells(z, 31) = TextBox31.Value
Cells(z, 32) = TextBox32.Value
Cells(z, 33) = TextBox33.Value
Cells(z, 34) = TextBox34.Value
Cells(z, 35) = TextBox35.Value
Cells(z, 36) = TextBox36.Value
Cells(z, 37) = TextBox37.Value
Cells(z, 38) = TextBox38.Value
Cells(z, 39) = TextBox39.Value
Cells(z, 40) = ComboBox40.Value
Cells(z, 41) = ComboBox41.Value
Cells(z, 42) = ComboBox42.Value
myArr = Sheets("finanzdaten").Range("A2:AP1000")
ComboBox1 = ""
ComboBox1.List = myArr
For iCounter = 1 To 39
Controls("TextBox" & iCounter) = ""
Next iCounter
For eCounter = 40 To 42
Controls("ComboBox" & eCounter) = ""
Next eCounter
End Sub

Vielen Dank
Peter S.
Anzeige

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: z = Range("A2:AP1000").Find(what:=....Falsch
04.08.2005 15:11:11
Beni
Hallo Peter,
mit LookAt:=xlWhole wird nach dem ganzen Inhalt gesucht.
Gruss Beni
z = Range("A2:AP1000").Find(what:=TextBox1, LookAt:=xlWhole).Row
Anzeige
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Entdecke relevante Threads

Schau dir verwandte Threads basierend auf dem aktuellen Thema an

Alle relevanten Threads mit Inhaltsvorschau entdecken

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige