Good Morning Everyone,
Looking for some recommendations on how I could prevent the RunTime Error 1004 while running VBA for an AutoFilter routine.
In the work sheet I have a ActiveX Combobox that is being used to select a value.
I would then like to filter records in a range of "A15:F" & LRow ( Last Row )
The code is being run on the selection of a new value in the ComboBox
Below is the code I have been working with.
Private Sub ComboBox1_Change()
Dim ComboVal As Long
Dim LRow As Long
LRow = Sheets("Labor_Entry_Form").Cells(Rows.Count, "A").End(xlUp).Row
ComboVal = ComboBox1.Value
With Sheets("Labor_Entry_Form")
.AutoFilterMode = False
.Range("A15:F" & LRow).AutoFilter
.Range("A15:F" & LRow).AutoFilter Field:=1, Criteria1:=ComboVal
End With
End Sub
Any help is greatly appreciated.
Thanks,
Bradley
Looking for some recommendations on how I could prevent the RunTime Error 1004 while running VBA for an AutoFilter routine.
In the work sheet I have a ActiveX Combobox that is being used to select a value.
I would then like to filter records in a range of "A15:F" & LRow ( Last Row )
The code is being run on the selection of a new value in the ComboBox
Below is the code I have been working with.
Private Sub ComboBox1_Change()
Dim ComboVal As Long
Dim LRow As Long
LRow = Sheets("Labor_Entry_Form").Cells(Rows.Count, "A").End(xlUp).Row
ComboVal = ComboBox1.Value
With Sheets("Labor_Entry_Form")
.AutoFilterMode = False
.Range("A15:F" & LRow).AutoFilter
.Range("A15:F" & LRow).AutoFilter Field:=1, Criteria1:=ComboVal
End With
End Sub
Any help is greatly appreciated.
Thanks,
Bradley