Hi all!
This is my first post so bare with me
I need some help with a VBA to export the value in all the cells from Column G into individual .txt files. The name of the text should be "Answer" Value in Column A. It all needs to be saved in the same directory as the Excel file itself.
What I have now is:
I hope someone can help me! Sorry if I put this post in the wrong place!
Thanks!
Martijn
This is my first post so bare with me

I need some help with a VBA to export the value in all the cells from Column G into individual .txt files. The name of the text should be "Answer" Value in Column A. It all needs to be saved in the same directory as the Excel file itself.
What I have now is:
Code:
'Copy the contents of a worksheet, and save it as a .txt fileSub CopyToTxt()
Dim wbSource As Workbook
Dim wsSource As Worksheet
Dim wbDest As Workbook
Dim fName As String
'References
Set wbSource = ActiveWorkbook
Set wsSource = ActiveSheet
Set wbDest = Workbooks.Add
wsSource.Range("G4:G4").Copy
wbDest.Worksheets(1).Cells(1, 1).PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Application.CutCopyMode = False
fName = ThisWorkbook.Path & "\answer.txt"
wbDest.SaveAs fName, xlText
wbDest.Close SaveChanges:=True
End Sub
I hope someone can help me! Sorry if I put this post in the wrong place!
Thanks!
Martijn