Testing
Testing
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
test
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
[VBA]
Sub SplitText()
Dim tName As String
Dim fName As String
Const ForReading = 1, ForWriting = 2, ForAppending = 3
pth = ActiveWorkbook.Path & "\"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(pth & "sample.txt", ForReading, TristateFalse)
txt = f.readall
f.Close
Set f = Nothing
Set fs = Nothing
a = Split(txt, "<BTAG>")
For i = 1 To UBound(a)
fName = Trim(Split(a(i), "<")(0)) & ".txt"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateTextFile(pth & fName, True)
f.write "<BTAG> " & a(i)
f.Close
Next
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
[VBA]Sub Macro1()
Dim t As Variant
Dim c
As Range
Set c = Range("A2")
t =
Split(c, Chr(10))
c.Resize(UBound(t)) =
Application.Transpose(t)
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'