VB Inserting different end points for flight tracks varying points each time. Unbelievably stuck now!

Johnno1980

New Member
Joined
Jul 27, 2011
Messages
4
Hi All,

I have tried various ways and still finding problems so I hope you are able to assist. I currently have a new macro which pulls a text file. In turn adds various points to a leading track. The end points may have 1/2/3/4 different end points and inn turn the leading tracks may also vary in number. So each leading track will need to be multiplied for the amount of end points with their respective point added to the end . I hope the below view shows the original and output I am looking to achieve but unfortunately I am unable to come up with a solution and your great assistance will be hugely appreciated. Many thanks i advance all. Steve
TypeOriginal DataEnd Waypoints DifferOutput data should look like this
End Point 1
DC METRO DEPARTURES OVER TOPPS/EBONY PLEASE FILE:

<tbody>
</tbody>
New End Point
Leading trackSWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.TOPPSSWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT TOPPS
Leading trackSWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.EBONYSWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT EBONY
End Point 2
DC METRO DEPARTURES OVER ALLEX PLEASE FILE:

<tbody>
</tbody>
New End Point
Leading trackSWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.WITCH.ALLEXSWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT..WITCH ALLEX
End Point 3
DC METRO DEPARTURES OVER BRADD/KANNI PLEASE FILE:

<tbody>
</tbody>
New End Point
Leading trackAGARD.SIE.J121.SHLEP.ACK.BRADDAGARD..SIE.J121.SHLEP..ACK BRADD
Leading trackAGARD.SIE.J121.SHLEP.ACK.KANNIAGARD..SIE.J121.SHLEP..ACK KANNI
Leading trackOR SWANN.BROSS.J42.RBV.ACK.BRADDOR SWANN..BROSS.J42.RBV..ACK BRADD
Leading trackOR SWANN.BROSS.J42.RBV.ACK.KANNIOR SWANN..BROSS.J42.RBV..ACK KANNI
End Point 4
DC METRO DEPARTURES OVER WHALE PLEASE FILE:

<tbody>
</tbody>
New End Point
Leading trackAGARD.SIE.J121.SHLEP.YAHOO.WHALEAGARD..SIE.J121.SHLEP..YAHOO WHALE
Leading trackOR SWANN.BROSS.J42.RBV.YAHOO.WHALEOR SWANN..BROSS.J42.RBV..YAHOO WHALE
End Point 5
DC METRO DEPARTURES OVER DOVEY PLEASE FILE:

<tbody>
</tbody>
New End Point
Leading trackAGARD.SIE.B24.LYNUS.LARGE.DOVEYAGARD..SIE.B24.LYNUS..LARGE DOVEY

<tbody>
</tbody>

Each end point will have "OVER" followed by one end point or multiple devided with "/" this could be two/three/four different end points
With that in mind the leading track needs to be duplicated by the amount of times there are end points for the above "End Point"
The output I have on the right.
E.g End point 1 has 2 end points therefore I need to duplicate the leading track twice and add the two to the end.
E.g End point 3 has 2 end points but also has two leadinng tracks so each leading track needs to be duplicated and the end points added.
E.g End point 4 has one end point but 2 leading tracks therefore the end point "Whale" needs to be added to both.
I hope this makes sense and you can help me as I am at a loss now and it's the last piece in a huge puzzle.

<tbody>
</tbody>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top