geht das auch in excel 97
23.09.2005 15:58:15
Basti
im folgenden Code, funktioniert diese Verschachtelung so wie in diesem Code auch in Excel 97 ?
Private Sub CommandButton3_Click()
Dim s, t As Range
Set s = Range("b:b").Find(UserForm4.Caption)
Set t = [b500].End(xlUp).Offset(1, 0)
If s.Offset(1, 0).Font.ColorIndex = 10 Then
''wenn schon eine Ressource eingetragen ist
Else 'wenn noch keine Ressource eingetragen wurde
If s.Offset(3, 0).Font.ColorIndex = 3 Or s.Offset(3, 0).Font.ColorIndex = 5 Then
s.End(xlDown).Offset(-2, 0).Select
ActiveCell.EntireRow.Insert
ActiveCell.EntireRow.Font.ColorIndex = 10
ActiveCell.Value = "R.:" & TextBox1.Value
ActiveCell.Font.Italic = True
ActiveCell.Font.Bold = False
ActiveCell.Font.Size = 10
ActiveCell.Offset(0, 1).Value = "-"
ActiveCell.Offset(0, 2).Value = "-"
Else
If s.Offset(1, 0).Value <> "" Then
s.End(xlDown).Select
ActiveCell.EntireRow.Insert
ActiveCell.EntireRow.Font.ColorIndex = 10
ActiveCell.Value = "R.:" & TextBox1.Value
ActiveCell.Font.Italic = True
ActiveCell.Font.Bold = False
ActiveCell.Font.Size = 10
ActiveCell.Offset(0, 1).Value = "-"
ActiveCell.Offset(0, 2).Value = "-"
Else
If s = t Then
s.Offset(1, 0).Select
ActiveCell.Value = "R.:" & TextBox1.Value
ActiveCell.Font.ColorIndex = 10
ActiveCell.Font.Italic = True
ActiveCell.Font.Bold = False
ActiveCell.Font.Size = 10
Else
s.Offset(1, 0).Select
ActiveCell.Value = "R.:" & TextBox1.Value
ActiveCell.Font.ColorIndex = 10
ActiveCell.Font.Italic = True
ActiveCell.Font.Bold = False
ActiveCell.Font.Size = 10
End If
End If
End If
End If
End Sub
Gruß Basti