R
rstroughair
I have a spreadsheet into which I import certain rows from a text file
and then parse to retrieve the information I need on a daily basis.
However, each time a new data type is introduced I need to amend the
code to include it. However, I believe this can be programmed quite
easily to avoid the need to change the VBA code for future data but am
struggling a little to do it!
Basically, I have a list of Pool IDs in Column A and I import the data
I need into Column B, then parse it. What I want to do is rewrite my
code such that the code reads the values in Cell A1 down to the last
cell in column A, then imports the relevant rows from my text file into
Column B1 downwards. That way all the user needs to do is to add a new
Pool ID to column A to include the data in the download.
Values in column A will be in the format:
P1
P2
P3
P4
P5
P6
P7
P8
P9
P10
P11
and the rows to be imported from the text file can be calculated using
the formulas:
(12 x P) - 9 and (12 x P) - 3, where P is the number of the Pool ID
(that is the number following the "P" in the column list above).
Thus in the example above, rows 3, 9, 15, 21, 27, 33, .... , 123 and
129 need to be imported from the text file.
Can anyone please give me an example on how I might go about
programming such code?
Many Thanks in advance,
Richard
and then parse to retrieve the information I need on a daily basis.
However, each time a new data type is introduced I need to amend the
code to include it. However, I believe this can be programmed quite
easily to avoid the need to change the VBA code for future data but am
struggling a little to do it!
Basically, I have a list of Pool IDs in Column A and I import the data
I need into Column B, then parse it. What I want to do is rewrite my
code such that the code reads the values in Cell A1 down to the last
cell in column A, then imports the relevant rows from my text file into
Column B1 downwards. That way all the user needs to do is to add a new
Pool ID to column A to include the data in the download.
Values in column A will be in the format:
P1
P2
P3
P4
P5
P6
P7
P8
P9
P10
P11
and the rows to be imported from the text file can be calculated using
the formulas:
(12 x P) - 9 and (12 x P) - 3, where P is the number of the Pool ID
(that is the number following the "P" in the column list above).
Thus in the example above, rows 3, 9, 15, 21, 27, 33, .... , 123 and
129 need to be imported from the text file.
Can anyone please give me an example on how I might go about
programming such code?
Many Thanks in advance,
Richard