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: 18
Default Extracting Values and inserting Rows/Values

Anyone know the best way to do this with an Excel Macro.
I have about 35 Files I need to Import Parse.
Here is the raw data Before Import:

ADD-DPLN:1,,,STN,N,,,,,;
ADD-DPLN:200000&&200005,,,STN,N,,,,,;
ADD-DPLN:200007,,,HUNT,N,,,,,;
ADD-DPLN:200009&&200125,,,STN,N,,,,,;

After I Import:
Sub Dpln_Import_Macro()
ChDir "C:\"
Workbooks.OpenText Filename:="C:\Regen Dplan.txt", Origin:=437,
StartRow _
:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=True,
Comma:=True, _
Space:=False, Other:=True, OtherChar:=":",
FieldInfo:=Array(Array(1, 9), _
Array(2, 2), Array(3, 2), Array(4, 2), Array(5, 2), Array(6,
2), Array(7, 2), Array(8, 2), _
Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 2)),
TrailingMinusNumbers:=True
Columns("A:E").Select
Columns("A:E").EntireColumn.AutoFit
Range("A1:E4").Select
Selection.Copy
Application.CutCopyMode = False
End Sub

This is what I need; to seperate out and Insert the Missing Numbers/
Rows between the "&&" signs, (I.e. the following is output: 200000,
200001, 200002, 200003, 200004, 200005)

1 STN N
200000&&200005 STN N
200007 HUNT N
200009&200125 STN N

I need to Expand the Numbers with an "&&". For example

200000&&200005 STN N

Should end up looking like:

1 STN N
200000 HUNT N
200001 HUNT N
200002 HUNT N
200003 HUNT N
200004 HUNT N
200005 HUNT N
200007 HUNT N
etc...

Any one have any suggestions for accomplishing this?
 
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
Match Values in Rows with Partial Values in Columns ryguy7272 Excel Worksheet Functions 3 August 8th 07 05:14 PM
Extracting rows from a spreadsheet using values from another shee Alex 46 Excel Discussion (Misc queries) 1 January 31st 07 07:27 PM
Inserting rows without changing formula values Hook''em 2006 Excel Worksheet Functions 5 December 27th 06 09:45 PM
counting rows with same values for multiple values Jon Viehe New Users to Excel 4 September 1st 05 03:49 PM
Inserting/Deleting Rows when values are added /cleared teresa Excel Programming 1 January 23rd 05 03:03 PM


All times are GMT +1. The time now is 11:13 AM.

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"