VBA- AutoFilter method of Range class falied
<p>Please note I am not a regular programmer, I have sufficient understanding of coding. I am making a form in which ComboBox1 gives Month, ComboBox2 gives starting date, Combobox3 given ending date.</p>

<p>In the code below, arraystr1 should have values in format - 2, "10/4/2015", 2, "10/5/2015", 2, "10/6/2015", 2, "10/7/2015"</p>

<p>Now my arraystr1 is giving me the values in same format but when I am running the program, its giving me error - "AutoFilter method of Range class falied"</p>

<pre><code>Dim Z As Long
Dim cbstr1 As String
Dim cbstr2 As String
Dim cbstr3 As String
Dim cbstr4 As String
Dim datestr1 As String
Dim datestr2 As String
Dim arraystr1 As String
Dim arraystr2 As String
Dim arraystr3 As String
Dim partstr1 As String
Dim partstr2 As String
partstr1 = " 2,"
partstr2 = ","
arraystr3 = ""



Select Case (ComboBox1.Text)

Case "January"
cbstr2 = "01"
//............//
Case "December"
cbstr2 = "12"
End Select

cbstr3 = ComboBox2.Text
cbstr4 = ComboBox3.Text

datestr1 = cbstr2 &amp; "/" &amp; cbstr3 &amp; "/2015"
datestr2 = cbstr2 &amp; "/" &amp; cbstr4 &amp; "/2015"

If cbstr3 = cbstr4 Then
arraystr1 = partstr1 &amp; Chr(34) &amp; datestr1 &amp; Chr(34)
Else
For Z = cbstr3 To cbstr4
If Z = cbstr4 Then
**arraystr1** = arraystr3 &amp; partstr1 &amp; Chr(34) &amp; datestr2 &amp; Chr(34)
Else
arraystr2 = cbstr2 &amp; "/" &amp; Z &amp; "/2015"
arraystr3 = partstr1 &amp; Chr(34) &amp; arraystr2 &amp; Chr(34) &amp; partstr2
End If
Next Z
End If
  MsgBox (arraystr1)


Sheets("Sheet13").UsedRange.ClearContents

Sheets("Full data").Range("$A$1:$AB$45107").AutoFilter Field:=14, Operator:= _
    xlFilterValues, Criteria2:=Array(**arraystr1**)
Selection.SpecialCells(xlCellTypeVisible).Select
Sheets("Full data").Select
Range("F:F,L:L,N:N,Q:Q,S:S").Select
Selection.Copy
Sheets("Sheet13").Select
Sheets("Sheet13").Cells(1, 1).Select
Sheets("Sheet13").Paste
Sheets("Sheet13").Range("C:C,E:E").Select
Application.CutCopyMode = False
Selection.NumberFormat = "General"
</code></pre>