Sub ExportColumnToText()
Dim DestFile As String, FileNum As Integer
Dim RowCount As Integer
LR = Cells(Rows.Count, "P").End(xlUp).Row
col = 16 ' p
DestFile = "D:\DATI\prova\" & range("P1").text & ".txt" ' <<< to be changed
FileNum = FreeFile()
On Error Resume Next
Open DestFile For Output As #FileNum
For RowCount = 1 To LR
Print #FileNum, "" & Cells(RowCount, col).Text
Next RowCount
Close #FileNum
End Sub