I have a text file which has data(sample data below), i
cannot import data directly into the excel sheet because
its a large file and it limits the excel rows for import.
I need to import from the text file phase by phase, the
data required.
Presume I have in the first line 'asmt 00005', i need to get
all the data until again i hit the other line 'asmt00006' and this data has to be parsed on fixedwidth . I need to know how do I improvise my macro to ensure that it starts import only from the first occurance of 'asmt 00005' untill it reaches 'asmt00006'
Since I am not too good with macros , I am importing the file from a specified row ( which can be different each time) . Please also note that I need theimported data as fixed width .
My macro's excerpt:-
Sub Macro1()
A1 = "INPUT THE DATE TO BE EXTRACTED"
A2 = "DATE FORMAT DDMMYY"
A = InputBox(A1 + " " + A2, "MIS EXTRACTOR")
D = Mid(A, 1, 2)
M = Mid(A, 3, 2)
Y = Mid(A, 5, 2)
TX = "as"
P = "J:\prod\asmtrpts\"
DT = P + TX + Y + M + D
DT1 = TX + Y + M + D
ChDir "J:\prod\asmtrpts\"
Workbooks.OpenText DT, xlWindows, 24000, xlFixedWidth, FieldInfo:=Array(Array(0, 1))
Txt. File Used for extracting data:-
JAS000000 - S140 wyx pno - IA (PRODUCTION)
JASM ORG 001 REPRESENTATIVE ACTION TOTALS PAGE 4
TIME 17:22:39
DACTI 0 .00 0 .00 9 .00
DADDR 3 .00 4 .00 80 .00
DBTI 1 .00 1 .00 56 .00
ASMT00005 - S140 wyx pno - IA (PRODUCTION)
JASM ORG 001 REPRESENTATIVE ACTION TOTALS PAGE 4
TIME 17:22:39
DACTI 0 .00 0 .00 9 .00
DADDR 3 .00 4 .00 80 .00
JAS000000 - S140 wyx pno - IA (PRODUCTION)
JASM ORG 001 REPRESENTATIVE ACTION TOTALS PAGE 4
ASMT00006 - S140 wyx pno - IA (PRODUCTION)
pLS help
Thanks !!
cannot import data directly into the excel sheet because
its a large file and it limits the excel rows for import.
I need to import from the text file phase by phase, the
data required.
Presume I have in the first line 'asmt 00005', i need to get
all the data until again i hit the other line 'asmt00006' and this data has to be parsed on fixedwidth . I need to know how do I improvise my macro to ensure that it starts import only from the first occurance of 'asmt 00005' untill it reaches 'asmt00006'
Since I am not too good with macros , I am importing the file from a specified row ( which can be different each time) . Please also note that I need theimported data as fixed width .
My macro's excerpt:-
Sub Macro1()
A1 = "INPUT THE DATE TO BE EXTRACTED"
A2 = "DATE FORMAT DDMMYY"
A = InputBox(A1 + " " + A2, "MIS EXTRACTOR")
D = Mid(A, 1, 2)
M = Mid(A, 3, 2)
Y = Mid(A, 5, 2)
TX = "as"
P = "J:\prod\asmtrpts\"
DT = P + TX + Y + M + D
DT1 = TX + Y + M + D
ChDir "J:\prod\asmtrpts\"
Workbooks.OpenText DT, xlWindows, 24000, xlFixedWidth, FieldInfo:=Array(Array(0, 1))
Txt. File Used for extracting data:-
JAS000000 - S140 wyx pno - IA (PRODUCTION)
JASM ORG 001 REPRESENTATIVE ACTION TOTALS PAGE 4
TIME 17:22:39
DACTI 0 .00 0 .00 9 .00
DADDR 3 .00 4 .00 80 .00
DBTI 1 .00 1 .00 56 .00
ASMT00005 - S140 wyx pno - IA (PRODUCTION)
JASM ORG 001 REPRESENTATIVE ACTION TOTALS PAGE 4
TIME 17:22:39
DACTI 0 .00 0 .00 9 .00
DADDR 3 .00 4 .00 80 .00
JAS000000 - S140 wyx pno - IA (PRODUCTION)
JASM ORG 001 REPRESENTATIVE ACTION TOTALS PAGE 4
ASMT00006 - S140 wyx pno - IA (PRODUCTION)
pLS help
Thanks !!