pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Why is this error happening...i think it is coded correctly...
Code:
[/FONT]
[FONT=Courier New]Sub filterme()
Dim x As String
Dim lr&
x = ActiveSheet.ComboBox1.Value
lr = Sheets("HOME").Range("K" & Rows.Count).End(xlUp).Row[/FONT]
[FONT=Courier New]ActiveSheet.Range("K1:N" & lr).Select
ActiveSheet.AutoFilterMode = False
ActiveSheet.Range("K1:N" & lr).AutoFilter Field:=4, Criteria1:=x
Range("K1:N" & lr).SpecialCells(xlCellTypeVisible).Copy Range("B2")
ActiveSheet.AutoFilterMode = False
End Sub[/FONT]
[FONT=Courier New]