ich habe ein Problemchen, seit der Umstellung auf Office 2007 kriege ich eine Fehlermeldung bei diesem Makro ( dies ist ein Auszug mit der Stelle, welche die Fehlermeldung verursacht - Laufzeitfehler 1004-, fett markiert):
Function GetCFCondition(cell As Range) As Integer
Dim mycell As Range
Dim myVal, myVal_1, myVal_2
Dim i As Integer
Dim done As Boolean
GetCFCondition = 0
Set mycell = cell(1)
mycell.Select
myVal = mycell.Value
For i = 1 To cell.FormatConditions.Count
With cell.FormatConditions.Item(i)
myVal_1 = GetCFVal(mycell, cell.FormatConditions.Item(i), False)
If .Type = 1 Then
If .Operator = xlBetween Or .Operator = xlNotBetween Then _
myVal_2 = GetCFVal(mycell, cell.FormatConditions.Item(i), True)
End If
If .Type = 1 Then
Select Case .Operator
Case xlBetween
done = (myVal >= myVal_1 And myVal = myVal_2 And myVal myVal_1
Case xlGreaterEqual
done = myVal >= myVal_1
Case xlLess
done = myVal myVal_1 And myVal > myVal_2)
Case xlNotEqual
done = myVal myVal_1
Case Else
MsgBox "Unbekannter Operator: " & .Operator, , "PANIC: In
Function GetCFCondition"
Exit Function
End Select
ElseIf .Type = 2 Then
done = myVal_1 = True
Else
MsgBox "Unbekannter Typ: " & .Type, , "PANIC: In
Function GetCFCondition"
Exit Function
End If
On Error GoTo 0
If done Then
GetCFCondition = i
Exit Function
End If
End With
Next
End Function
Für Hilfe wäre ich sehr sehr dankbar.
Vielen Dank im Voraus!
Gruss
artuk