I am pretty new at VBA and am not sure why I am getting object error 424 Here is the code so far.
Any help with this would be greatly appreciated!
Thank you ahead of time,
Jeff
Code:
Private Sub Workbook_Open()With Sheet1.ComboBox1
.AddItem ""
.AddItem "5% or less"
.AddItem ">5 - 15%"
.AddItem ">15% - 25%"
.AddItem ">25% - 35%"
.AddItem ">35%"
End With
Code:
With Sheet1.ComboBox2
.AddItem ""
.AddItem "-0.850 V or less negative"
.AddItem "more negative than -0.850 V"
End With
End Sub
Private Sub ComboBox1_Change()
If ComboBox1.Value = "" Then
ActiveSheet.Range("F2:F3246").AutoFilter Field:=1, Criteria1:=""
End If
If ComboBox.Value = "5% or less" Then
ActiveSheet.Range("F2:F3246").AutoFilter Field:=1, Criteria1:="<=5"
End If
If ComboBox1.Value = ">5% - 15%" Then
ActiveSheet.Range("F2:F3246").AutoFilter Field:=1, Criteria1:=">5", Criteria2:="<=15"
End If
If ComboBox1.Value = ">15% - 25%" Then
ActiveSheet.Range("F2:F3246").AutoFilter Field:=1, Criteria1:=">15", Criteria2:="<=25"
End If
If ComboBox1.Value = ">25% - 35%" Then
ActiveSheet.Range("F2:F3246").AutoFilter Field:=1, Criteria1:=">25", Criteria2:="<=35"
End If
If ComboBox1.Value = ">35%" Then
ActiveSheet.Range("F2:F3246").AutoFilter Field:=1, Criteria1:=">35"
End If
End Sub
Private Sub ComboBox2_Change()
If ComboBox2.Value = "" Then
ActiveSheet.Range("g2:g3246").AutoFilter Field:=1, Criteria1:=""
End If
If ComboBox2.Value = "-0.850 V or less negative" Then
ActiveSheet.Range("g2:g3246").AutoFilter Field:=1, Criteria1:=">=-0.850"
End If
If ComboBox2.Value = "more negative than -0.850 V" Then
ActiveSheet.Range("g2:g3246").AutoFilter Field:=1, Criteria1:="<-0.850"
End If
End Sub
Any help with this would be greatly appreciated!
Thank you ahead of time,
Jeff