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

Da fehlt ein End If, aber wo?

Forumthread: Da fehlt ein End If, aber wo?

Da fehlt ein End If, aber wo?
15.10.2003 10:52:38
xico
Hallo liebe Forumsteilnehmer,

als blutiger VBA-Anfänger, der seinen Spass daran gefunden hat, habe ich im folgenden Code ein End If fehlerhaft:


Sub Increase()
Dim d, e As Integer
For d = Sheets(1).Cells(13, 11).Value To 16
For e = 41 To 80
If Sheets(1).Cells(13, 11) = "99" Then
Exit Sub
Else
If Cells(e, 25) <> "1" Then
Next e
Else
Select Case Cells(e, d)
Case Is = ""
Cells(e, d) = ""
Case Is <> ""
Cells(e, d) = Cells(e, d) * Sheets(1).Cells(13, 4)
End Select
End If
End If
Next e
Next d
End Sub


Ich habe schon so manches probiert, geht aber nicht.

Danke für Antworten.
Xico
Anzeige

5
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Da fehlt ein End If, aber wo?
15.10.2003 10:59:54
GerdW
If sind schon ok aber das hier:
If Cells(e, 25) <> "1" Then
Next e 'hat hier nichts zu suchen
Else

Gerd
AW: Da fehlt ein End If, aber wo?
15.10.2003 10:59:56
Andreas St
Hallo,

du hast zweimal next e, das geht so nicht.

Versuch's mal so:
(Mit Goto und Sprungmarken zu arbeiten ist zwar nicht gerade so toll, aber was soll's)

Sub Increase()
Dim d, e As Integer
For d = Sheets(1).Cells(13, 11).Value To 16
For e = 41 To 80
If Sheets(1).Cells(13, 11) = "99" Then
Exit Sub
Else
If Cells(e, 25) <> "1" Then
GoTo Marke
Else
Select Case Cells(e, d)
Case Is = ""
Cells(e, d) = ""
Case Is <> ""
Cells(e, d) = Cells(e, d) * Sheets(1).Cells(13, 4)
End Select
End If
End If
Marke:
Next e
Next d
End Sub


Gruss
Andreas
Anzeige
AW: Da fehlt ein End If, aber wo?
15.10.2003 11:01:08
Andreas Walter
Ich tippe auf


Sub Increase()
Dim d, e As Integer
For d = Sheets(1).Cells(13, 11).Value To 16
For e = 41 To 80
If Sheets(1).Cells(13, 11) = "99" Then
Exit Sub
Else
If Cells(e, 25) <> "1" Then
Exit For   <-------------------------------Hier geändert
Else
Select Case Cells(e, d)
Case Is = ""
Cells(e, d) = ""
Case Is <> ""
Cells(e, d) = Cells(e, d) * Sheets(1).Cells(13, 4)
End Select
End If
End If
Next e
Next d
End Sub

Anzeige
AW: Da fehlt ein End If, aber wo?
15.10.2003 11:03:04
RAnton
Hall Xico,

das geht so nicht.


Sub Increase()
Dim d, e As Integer
For d = Sheets(1).Cells(13, 11).Value To 16
For e = 41 To 80
If Sheets(1).Cells(13, 11) = "99" Then
Exit Sub
Else
If Cells(e, 25) <> "1" Then
Next e <------------------------- dieses Next macht keinen Sinn
Else
Select Case Cells(e, d)
Case Is = ""
Cells(e, d) = ""
Case Is <> ""
Cells(e, d) = Cells(e, d) * Sheets(1).Cells(13, 4)
End Select
End If
End If
Next e
Next d
End Sub


Was genau willst du denn machen.

Gruß
RAnton
Anzeige
Danke
15.10.2003 11:16:03
Xico
Lieben Dank an Euch :-)
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige