Hi,
I have this VBA code:
Please Login or Register  to view this content.
Now, first I would like to check how many of records
Please Login or Register  to view this content.
returns and base on that to import/export data into excel or .csv file.
So, if COUNT of SQL statement is < 1 million THEN import data directly in current workbook but if COUNT of SQL statement is >= 1 million THEN export data into .csv file.

Any idea how to do this?

Thanks.