My Criteria will not work

Darren Smith

Well-known Member
Joined
Nov 23, 2020
Messages
631
Office Version
  1. 2019
Platform
  1. Windows
This code says on Criteria Name Argument not found??
Can anybody say why?

VBA Code:
Private Sub Filter_Jobs_By_Months_Click()
Dim Database(1 To 100, 1 To 15)
Dim My_Range As Integer
Dim colum As Byte
Dim ws As Worksheet

Application.ScreenUpdating = False

Set ws = ThisWorkbook.Worksheets("TGS JOB RECORD")
On Error Resume Next
ws.Range("A2").AutoFilter Field:=11, Criteria:=Me.Months.Value
For i = 2 To ws.Range("A10000").End(xlUp).Row
If ws.Cells(i, 11) = Me.Months Then

My_Range = My_Range + 1
For colum = 1 To 15
Database(My_Range, colum) = ws.Cells(i, colum)
Next colum
End If
Next i
Me.WIPMonthly.List = Database

Application.ScreenUpdating = true

Exit Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
The arguments are Criteria1 and optionally Criteria2, not Criteria.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top