Afternoon everyone,
Im currently using vba to connect two comboboxes in excel.
The code is doing what it is supposed to; however, it is still giving me an error code and i cannot wrap my head around it.
I get error 1004: AdvancedFilter Method of Range class failed.
Any help on this would be greatly appreciated!
Im currently using vba to connect two comboboxes in excel.
The code is doing what it is supposed to; however, it is still giving me an error code and i cannot wrap my head around it.
Code:
Private Sub cboSupplier_Change()
Dim r As Integer
r = 2
Range("M2") = cboSupplier.Value
Columns("J:K").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"M1:M2"), CopyToRange:=Range("O1:P1"), Unique:=False
cboFund.Clear
Do Until Cells(r, 16).Value = ""
cboFund.AddItem Cells(r, 16).Value
r = r + 1
Loop
End Sub
I get error 1004: AdvancedFilter Method of Range class failed.
Any help on this would be greatly appreciated!