Split data based on the 6th&7th character of a matrix file

gseri

New Member
Joined
Feb 21, 2011
Messages
4
Hi,
Again wondering if i could find a good soul out there to give me a hand on the following (Under POSTS).

I have a data file as the following:

The trick is 'how' on earth to write a vba which could distinguish what triggers the separation of POSTS on POSTS_1, AND POSTS_2. The separation is based on the 6th and 7th charater of the data lines (i.e.,
'Ise3' 65 65 88 88 1 66 'Y' / ), on which if its from 1 to 25 is written on POSTS_1, and if is withing 26 to 66 is written on POSTS_2.


POSTS
-- IX1 IX2 IY1 IY2 IZ1 IZ2 FACE
'Ise3' 65 65 88 88 1 66 'Y' /
'Ise3' 66 66 88 88 1 66 'Y' /
'Ise3' 67 67 88 88 1 66 'Y' /
'Ise3' 68 68 88 88 1 66 'Y' /
'Ise3' 69 69 88 88 1 66 'Y' /
'Knw' 77 77 89 89 44 66 'Y' /
'Knw' 78 78 89 89 44 66 'Y' /
'Knw' 78 78 89 89 44 66 'X' /
'Knw' 79 79 88 88 49 66 'Y' /
'Knw' 79 79 89 89 48 66 'X' /
'Knw' 80 80 89 89 54 66 'Y' /

Which I would like to Divide as follow

POSTS_1
-- IX1 IX2 IY1 IY2 IZ1 IZ2 FACE
'Ise3' 65 65 88 88 1 66 'Y' /
'Ise3' 66 66 88 88 1 66 'Y' /
'Ise3' 67 67 88 88 1 66 'Y' /
'Ise3' 68 68 88 88 1 66 'Y' /
'Ise3' 69 69 88 88 1 66 'Y' /

POSTS_2
'Knw' 77 77 89 89 44 66 'Y' /
'Knw' 78 78 89 89 44 66 'Y' /
'Knw' 78 78 89 89 44 66 'X' /
'Knw' 79 79 88 88 49 66 'Y' /
'Knw' 79 79 89 89 48 66 'X' /
'Knw' 80 80 89 89 54 66 'Y' /

Best regards,


gseri
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Manually do this first:

Select the column

Click Data / Text to Columns

Choose delimited and click next then choose a space as your delimeter.

Click finish.

Did that do what you want? If so do it again using the macro recorder and it will record exactly what you need for your data set :).

Let me know if it doesn't work and we can try something else.

Cheers

Dan
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,671
Members
452,937
Latest member
Bhg1984

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