Live-Forum - Die aktuellen Beiträge
Datum
Titel
29.03.2024 13:14:12
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
216to220
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
216to220
216to220
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

For - Next funktioniert nicht

For - Next funktioniert nicht
12.02.2003 14:59:32
Hans
hallo zusammen,

kann mir jemand sagen warum bei dem unten stehenden Code der Fehler "Next ohne For" auftritt?

If ComboBox2 = "ändern" Then
Sheets("Baugruppe").Select
letzteZeile = ActiveSheet.UsedRange.Rows.Count
Cells.Find(What:=ComboBox1, After:=A1, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
For j = 1 To letzteZeile
If ActiveCell = ComboBox1 And _
ActiveCell.Offset(0, 1) = ComboBox1.List(ComboBox1.ListIndex, 1) And _
ActiveCell.Offset(0, 2) = TextBox1 And ActiveCell.Offset(0, 3) = TextBox2 And _
ActiveCell.Offset(0, 4) = TextBox3 And ActiveCell.Offset(0, 5) = TextBox4 And _
ActiveCell.Offset(0, 6) = TextBox5 And ActiveCell.Offset(0, 7) = TextBox6 And _
ActiveCell.Offset(0, 8) = TextBox7 And ActiveCell.Offset(0, 9) = TextBox8 And _
ActiveCell.Offset(0, 10) = TextBox9 And ActiveCell.Offset(0, 11) = TextBox10 And _
ActiveCell.Offset(0, 12) = TextBox11 And ActiveCell.Offset(0, 13) = TextBox12 And _
ActiveCell.Offset(0, 14) = TextBox13 And ActiveCell.Offset(0, 15) = TextBox14 And _
ActiveCell.Offset(0, 16) = TextBox15 And ActiveCell.Offset(0, 17) = TextBox16 And _
ActiveCell.Offset(0, 18) = TextBox17 And ActiveCell.Offset(0, 19) = TextBox18 And _
ActiveCell.Offset(0, 20) = TextBox19 And ActiveCell.Offset(0, 21) = TextBox20 And _
ActiveCell.Offset(0, 22) = TextBox21 And ActiveCell.Offset(0, 23) = TextBox22 And _
ActiveCell.Offset(0, 24) = TextBox23 And ActiveCell.Offset(0, 25) = TextBox24 And _
ActiveCell.Offset(0, 26) = TextBox25 And ActiveCell.Offset(0, 27) = TextBox26 And _
ActiveCell.Offset(0, 28) = TextBox27 Then
ActiveCell.Select
Else
Cells.FindNext(After:=ActiveCell).Activate
Next j
End If

Bin für eure hilfe sehr dankbar
Gruß
Hans

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Re: For - Next funktioniert nicht
12.02.2003 15:02:53
Boris

Hi Hans,

das End if gehört VOR Next j.

Gruß Boris

Re: For - Next funktioniert nicht
12.02.2003 15:08:12
Dirk

Nach erstem ansehen am Ende:

End if 'das scheint zu fehlen
next j
end if

Vielleicht fehlt es auch am Anfang, vor der Schleife, kommt drauf an, was dú machen willst.

Gruß Dirk


Re: For - Next funktioniert nicht
12.02.2003 15:08:41
Jörg

Hallo
das end if muß zusätzlich vor next j
Gruß jörg

Re: For - Next funktioniert nicht
12.02.2003 15:14:02
Hans

hallo,

das ist es gewesen, danke euch allen.
allerdings hab ich jetzt einen fehler bei
cells.Find(What:=ComboBox1, After:=A1, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Select

Kann mir auch jemand sagen was dass sein soll
(Bin ein ziemlicher anfänger, dass weiß ich)
schönen gruß
Hans

Anzeige

299 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige