Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do a import data from a text file to an excel worksheet madlin Excel Discussion (Misc queries) 4 January 12th 10 04:04 PM
how to import more than 1 text file into the same Excel worksheet. SinnetBS Excel Discussion (Misc queries) 1 June 14th 06 03:14 AM
How to transpose an excel worksheet having more than 10000 rows into a text file, may by tab delimit Fred zheng Excel Programming 4 October 12th 05 06:07 PM
Import and transpose tab seperated data from text file phillip harrison Excel Programming 0 July 22nd 03 05:44 PM
Import and transpose tab seperated data from text file phillip harrison Excel Programming 1 July 17th 03 03:48 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"