Code:
ReDim array_values(aheight)
Do Until count = aheight
'repopulate the first cell
If IsNumeric(array_fields(count_2 + 1)) Then
strQuote = vbNullString
Else
strQuote = "'"
End If
cell = strQuote & esc(array_fields(count_2)) & strQuote
'Populate the cell value
Do Until count_3 = aWidth
If isNumeric(array_fields(count_2, (count_2 + 1))) Then ----> subscript error here
strQuote = vbNullString
Else
strQuote = "'"
End If
cell_2 = cell_2 & ", " & strQuote & esc(array_fields(count_2, (count_3 + 1))) & strQuote
count_3 = count_3 + 1
Loop