LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Importing Specific Rows from a text file into Excel

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

 
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
Importing CSV file with more than 65535 rows to Excel 2007 [email protected] Excel Discussion (Misc queries) 7 May 13th 09 01:29 PM
Importing on certain rows from a text file into excel [email protected] Excel Programming 0 June 20th 06 11:37 AM
importing text file in excel UT Excel Discussion (Misc queries) 0 March 16th 06 10:20 PM
Importing a text file into Excel with too many rows? Nexan Excel Discussion (Misc queries) 2 August 17th 05 01:52 PM
Importing Text File with more than 65536 rows Allan Excel Programming 4 May 16th 05 01:34 AM


All times are GMT +1. The time now is 09:43 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"