Excel VBA:Type misMatch error in using Index and Match functions
<p>I encounter error in index and match functions when the counter of date changes. I wrote a comment when I face with error. here is the code :</p>

<pre><code>Sub regionalAverage()

Application.ScreenUpdating = False

Application.DisplayStatusBar = False

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False

Dim address(2) As String
Dim rw As Variant
Dim col As Variant
Dim date_ini As Date
Dim date_fin As Date

   'create WorkSheet

date_ini = #1/1/2008#
date_fin = #1/4/2008#
For j = 1 To 3
    For conteo = date_ini To date_fin
        For i = 1 To 2
            With Sheets(i)
                With Application
                 col = .Match(j, Worksheets(i).Range("F2:F23393"), 0)
                 rw = .Match(CLng(conteo), Worksheets(i).Range("D2:D23393"), 0)
                 address(i) = .Index(Worksheets(i).Range("H2:H23393"), col,  rw)
                ' the error appear here
                End With

            End With
        Next i
    '    computation
        area = 6.429571
        Sheets("Output").Activate
        Range("A1").Select
        ActiveCell.Offset(0, j).Select
        colname = Split(ActiveCell(1).address(1, 0), "$")(0)
        Columns("" &amp; colname &amp; ":" &amp; colname &amp; "").Select
        Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, _
             LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
             MatchCase:=False, SearchFormat:=False).Select

        ActiveCell.Value = "=(SUM(" &amp; address(1) &amp; "," &amp; address(2) &amp; "))/" &amp; area &amp; ""

    Next conteo
Next j

End Sub
</code></pre>

<p>When the date changes to 1/2/2008 I face with error, how can I solve it ?! </p>

<p>Thank you </p>