Hi,

I have a procedure that writes values out to a file. The idea is that data is pasted in to my spreadsheet, a column on the right has the following folmulae to take that pasted data and put it in to the correct format for writing to the fil:

=TEXT(J6,"YYYY-dd-MM")&","""&LEFT(K6,20)&""","""&LEFT(P6,1)&RIGHT(P6,1)&""","""&TEXT(R6,"0.00")&""",,"""&B6&""","""&"IWC HOUSING BENEFITS"&""",0,"""&E6&""",""NWB"","""&A6&""","""&LEFT(K6,6)&""""


at the top of the page is a "GO" button. the user presses the button and the VB procedure finds the last row of data and then writes the string created by the formulated coumn out to a text file.

Unfortunatly, i am having an occasional problem where a date is supplied incorrectly, the procedure doesnt have any handling of incorrect dates (like a message and bombing out). Would anyone have any ideas hwo i could get the procedure to recognise when the YYYY-dd-MM is not correct?

I have tried to nip this in the bud with the source data, but unfortunatly my supplier isnt particually helpfull!!