Else ohne If Block
27.03.2006 12:34:04
Josef
Ich bekomme bei unten stehendem Code den Fehlehinweis Else ohne If Block.
Ich habe jedoch einen If Block.
Wo liege ich hier bitte falsch?
Danke
Josef
Private Sub CommandButton2_Click()
If CheckBox1.Value = False Then
If CheckBox3.Value = False Then GoTo WEITER
If CheckBox5.Value = False Then GoTo WEITER
If CheckBox7.Value = False Then GoTo WEITER
If CheckBox9.Value = False Then GoTo WEITER
If CheckBox11.Value = False Then GoTo WEITER
If CheckBox13.Value = False Then GoTo WEITER
If CheckBox15.Value = False Then GoTo WEITER
If CheckBox17.Value = False Then GoTo WEITER
If CheckBox19.Value = False Then GoTo WEITER
If CheckBox21.Value = False Then GoTo WEITER
If CheckBox23.Value = False Then GoTo WEITER
End If
Else
Dim rngFind As Range
Dim intCount As Integer, intCol As Integer, lngRow As Long
If Not IsDate(datumtxt1) Then Exit Sub
With ActiveSheet
Set rngFind = .Range("B:B").Find(What:=CDate(datumtxt1), LookAt:=xlWhole, LookIn:=xlFormulas)
If Not rngFind Is Nothing Then
lngRow = rngFind.Row
intCol = 26
For intCount = 1 To 23
Select Case intCount
Case 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23
'If Controls("CheckBox" & intCount) > 0 Then
If Len(Trim$(Controls("CheckBox" & intCount))) > 0 Then
If IsNumeric(Controls("CheckBox" & intCount)) Then
'.Cells(lngRow, intCol) = CSng(Controls("CheckBox" & intCount))
.Cells(lngRow, intCol) = Abs(CDbl(Controls("CheckBox" & intCount)))
Else
.Cells(lngRow, intCol) = Controls("CheckBox" & intCount)
End If
End If
intCol = intCol + 1
Case Else
lngRow = lngRow + 1
intCol = 26
End Select
Next
End If
Set rngFind = Nothing
End With
End If
WEITER:
Exit Sub
End Sub