Excel 2003

I have looked around to find a close solution but none seem to work entirely to my needs

I'm not very familiar with writing macros and can really use some help with this.

I wish to create a macro that will create a .dat text file and place it within the current folder that the workbook is in. The data is isolated on its own sheet called "DAT". The data is located down only column A and the amount of rows may vary based on input elsewhere in the workbook. I want the created file to be named after the input of a cell in another sheet.

The data in each row in the "DAT" sheet is comma separated through formulas ex. A1 =IF(SOMECELL="OUT OF RANGE","",ROUND(M2,0)&","&ROUND(N2,0)...etc - all of the referenced cells are in another sheet
First it checkes if data is available, and if not it will return a ""

I need verbatim, only the data that is visible in the cells ie."Values" and if it scans a blank row ("") from of the "OUT OF RANGE" condition while creating the .dat file I want it to stop scanning and create the .dat in a way that it doesnt export a bunch of blank rows placed after the populated data.

any help would be greatly appreciated