G
Guest
Hi Everyone,
I'm relatively new to using macro's. I have a lot of text files that are
created by a data logger that take an age to work through. I have created a
master template that contains everything that needs doing to a dataset, and I
have recorded a macro that opens the template and then imports a data file to
a set range in the template.
My problem is that the macro does not allow me to select the file/folder
name of the data I want to import. I've included my code so far below - can
anyone help me please?
Many thanks in advance for your help!
Jay_B
Sub Data_Import()
'
' Data Import Macro
' Macro recorded by Me
'
'
Workbooks.Open Filename:="E:\conv\transposed master.xls"
ActiveWindow.SmallScroll Down:=-156
Range("A1").Select
With
ActiveSheet.QueryTables.Add(Connection:="TEXT;E:\conv\06060621\ASAB2.1" _
, Destination:=Range("A1"))
.Name = "ASAB2.1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Sheets("transposed data").Select
ActiveWindow.SmallScroll Down:=-21
Sheets("Pressure Trace").Select
ActiveWindow.Zoom = True
End Sub
I'm relatively new to using macro's. I have a lot of text files that are
created by a data logger that take an age to work through. I have created a
master template that contains everything that needs doing to a dataset, and I
have recorded a macro that opens the template and then imports a data file to
a set range in the template.
My problem is that the macro does not allow me to select the file/folder
name of the data I want to import. I've included my code so far below - can
anyone help me please?
Many thanks in advance for your help!
Jay_B
Sub Data_Import()
'
' Data Import Macro
' Macro recorded by Me
'
'
Workbooks.Open Filename:="E:\conv\transposed master.xls"
ActiveWindow.SmallScroll Down:=-156
Range("A1").Select
With
ActiveSheet.QueryTables.Add(Connection:="TEXT;E:\conv\06060621\ASAB2.1" _
, Destination:=Range("A1"))
.Name = "ASAB2.1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Sheets("transposed data").Select
ActiveWindow.SmallScroll Down:=-21
Sheets("Pressure Trace").Select
ActiveWindow.Zoom = True
End Sub