+ Reply to Thread
Results 1 to 5 of 5

Help: Import text > transpose > append to new worksheet

Hybrid View

Guest Help: Import text > transpose... 04-18-2006, 08:30 AM
Guest RE: Help: Import text >... 04-18-2006, 08:50 AM
Guest Re: Help: Import text >... 04-18-2006, 09:40 AM
Guest Re: Help: Import text >... 04-18-2006, 10:15 PM
Guest Re: Help: Import text >... 04-19-2006, 10:35 PM
  1. #1
    javamom
    Guest

    Re: Help: Import text > transpose > append to new worksheet

    Thanks Tom! I will try this out and report back. Trish


  2. #2
    javamom
    Guest

    Re: Help: Import text > transpose > append to new worksheet

    This seems to be working well. Thanks!

    One more question: I need to indicate a semicolon as a delimiter. I've
    been looking at examples using sep but am not quite sure how to
    incorporate that into the above script.

    Thanks again! Trish


  3. #3
    javamom
    Guest

    Re: Help: Import text > transpose > append to new worksheet

    My attempt to recognize the semicolon delimiter upon opening the text
    files is not going well. I thought I had something close to working,
    but apparently not. Here is where I stand now:

    Sub Processfiles()
    Dim sname As String, bk As Workbook
    Dim rng1 As Range, rng2 As Range
    sname = Dir("C:\MyTextFiles\*.*")
    Do While sname <> ""

    Workbooks.OpenText _
    Filename:=sname, Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited,
    TextQualifier _
    :=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:= _
    True, Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(1, 1)

    Set bk = ActiveWorkbook

    With bk.Worksheets(1)
    Set rng1 = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
    End With
    Set rng2 = Workbooks("MasterList.xls").Worksheets(1) _
    .Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
    rng1.Copy
    rng2.PasteSpecial xlValues, Transpose:=True
    bk.Close Savechanges:=False
    sname = Dir
    Loop
    End Sub

    Apologies if I've really butchered this! Trying to understand. Really
    fuzzy still on when to use workbooks.open or workbooks.opentext. Any
    help is greatly appreciated.

    Thanks! Trish


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1