Hallo zusammen,
das folgende Makro funktioniert in Excel 2003 leider nicht. Warum?
Private Sub ComboBox1_Change()
ComboBox1.Value = Format(ComboBox1.Value, "0000")
End Sub
Private Sub ComboBox2_Change()
ComboBox2.Value = Format(ComboBox2.Value, "dd.mm.yyyy")
End Sub
Private Sub ComboBox3_Change()
ComboBox3.Value = Format((ComboBox3.Value), "00.00 €")
End Sub
Private Sub CommandButton4_Click()
Unload Me
End Sub
Private Sub CommandButton1_Click()
Selection.AutoFilter Field:=1, Criteria1:=">=" & CDbl(ComboBox1.Value), _
Operator:=xlAnd, _
Criteria2:="<=" & CDbl(ComboBox1.Value)
End Sub
Private Sub CommandButton2_Click()
Selection.AutoFilter Field:=2, Criteria1:=">=" & CDbl(CDate(ComboBox2.Value)), _
Operator:=xlAnd, _
Criteria2:="<=" & CDbl(CDate(ComboBox2.Value))
End Sub
Private Sub CommandButton3_Click()
Selection.AutoFilter Field:=3, Criteria1:=">=" & CDbl(ComboBox3.Value), _
Operator:=xlAnd, _
Criteria2:="<=" & CDbl(ComboBox3.Value)
End Sub
Private Sub CommandButton5_Click()
Selection.AutoFilter Field:=4, Criteria1:=ComboBox4.Value
End Sub
Private Sub CommandButton27_Click()
On Error GoTo fehler
ComboBox1.ListIndex = -1
ComboBox2.ListIndex = -1
ComboBox3.ListIndex = -1
ComboBox4.ListIndex = -1
ActiveSheet.ShowAllData
Range("A4").Select
Exit Sub
fehler:
MsgBox "Es wird schon alles angezeigt!"
End Sub
In Excel 2003 bekomme ich folgende Fehlermeldung:
Fehler beim Kompilieren: Projekt oder Bibliothek nicht gefunden. ("Format")
In Excel 2007 z.B. Funktioniert es!
Wie oder was muss man ändern damit es auch in Excel 2003 funktioniert.
Im Voraus vielen Dank!
Gruß ABO