Assuming you are actually using Excel now...
First, like I said in one of my comments, you should start here to learn about using Visual Basic for Applications (VBA) on your own.
In Excel, it will be easiest to activate the Developer tab to access the the Visual Basic Editor.
- Go to File>Options>Customize the Ribbon.
- Check the Developer tab. Click Ok.
- Go to Developer and under the
Code
section is Visual Basic. Click this to open the VBA editor.
Now you can make VBA subs. You can put them in specific sheets, the workbook as a whole, or modules in your PERSONAL.XLSB
which allows any Excel workbook with macros enabled to run them.
You may need to create a module. If so:
- Right-click on
VBAProject (PERSONAL.XLSB)
.
Insert
>Module
- Name it.
You can now paste code into the module and you have a "macro".
The easiest way to run this is to
- Go to the Developer tab.
- Hit Macros.
- Select your macro.
- Hit Run.
You can also assign a keyboard shortcut by hitting Options... in that same Macros
menu.
Now you can essentially copy and paste the code from here. With a slight modification:
Sub Export_Files()
Dim sExportFolder, sFN
Dim rTitle As Range
Dim rContent As Range
Dim oSh As Worksheet
Dim oFS As Object
Dim oTxt As Object
'sExportFolder = path to the folder you want to export to
'oSh = The sheet where your data is stored
sExportFolder = "C:\Disclaimers"
Set oSh = Sheet1
Set oFS = CreateObject("Scripting.Filesystemobject")
For Each rTitle In oSh.UsedRange.Columns("A").Cells
Set rContent = rTitle.Offset(, 1) & ", " & rTitle.Offset(, 2) '<--This will put in your Column B and C value. You can delimit with whatever you desire; I used a comma and space.
'Add .txt to the article name as a file name
sFN = rTitle.Value & ".txt"
Set oTxt = oFS.OpenTextFile(sExportFolder & "\" & sFN, 2, True)
oTxt.Write rContent.Value
oTxt.Close
Next
End Sub