Consulting

Results 1 to 5 of 5

Thread: Upload test

  1. #1
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location

    Upload test

    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'

  2. #2
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    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'

  3. #3
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [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'

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    email
    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'

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [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'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •