Hi All is there someone can help be on how to create a text files using multiline values of a textbox as filenames?
I have a multiline textbox in a userform in which I input multiple values. My code can create text file if I just input one value but if I input 2 or more nothing created. Can you help me identify which code is missing in my code just to create text files and the name of the files should be each values in the multiline textbox? I already tried searching but it looks like no topic as same as my concern. Thank you in advance for any help.
Below is my code.
Private Sub CREATE_REQ_Click()
Dim sExportFolder, sFN
Dim oFS As Object
Dim oTxt As Object
sExportFolder = TextBox1 ' "D:\TEST\REQ_FILES_CREATED_HERE"
Set oFS = CreateObject("Scripting.Filesystemobject")
For Each strLine In TextLogistic
'Add .txt to the article name as a file name
sFN = "-" & TextLogistic.Value & ".req"
Set oTxt = oFS.OpenTextFile(sExportFolder & "\" & ListBox1 & sFN, 2, True)
oTxt.Write combo1.Value
oTxt.Close
Next
End Sub