Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do a import data from a text file to an excel worksheet | Excel Discussion (Misc queries) | |||
how to import more than 1 text file into the same Excel worksheet. | Excel Discussion (Misc queries) | |||
How to transpose an excel worksheet having more than 10000 rows into a text file, may by tab delimit | Excel Programming | |||
Import and transpose tab seperated data from text file | Excel Programming | |||
Import and transpose tab seperated data from text file | Excel Programming |