Sub test()
Dim Enrgt As String, Wbk As Workbook, C As Range
Close #1
Set Wbk = Workbooks.Open("FDS.xlsx")
Open "X.txt" For Output As #1
With Sheets("X")
For Each C In .Range("F7", .Cells(.Rows.Count, 6).End(xlUp))
Enrgt = C.Value
Print #1, Enrgt
Next C
End With
Close #1
Open "Y.txt" For Output As #1
With Sheets("Y")
For Each C In .Range("F7", .Cells(.Rows.Count, 6).End(xlUp))
Enrgt = C.Value
Print #1, Enrgt
Next C
End With
Close #1
End Sub