Ashish Batham
Member
If (rs.RecordCount > 0) Then
cnt = 1
For Each fld In rs.Fields
wks.Cells(1, cnt).Value = fld.Name
cnt = cnt + 1
Next fld
Call rng.CopyFromRecordset(rs, 4000, 26)
End If
cnt = 1
For Each fld In rs.Fields
wks.Cells(1, cnt).Value = fld.Name
cnt = cnt + 1
Next fld
Call rng.CopyFromRecordset(rs, 4000, 26)
End If