Macro Help Needed - Copy data row(s) from column into new file

Closed
Burt_Macklin Posts 4 Registration date Friday June 27, 2014 Status Member Last seen July 17, 2014 - Jun 27, 2014 at 03:41 PM
Burt_Macklin Posts 4 Registration date Friday June 27, 2014 Status Member Last seen July 17, 2014 - Jul 17, 2014 at 10:40 AM
Hello and thank you in advance.

I was trying to follow along with the answer given here, but I'm not well versed in macros. https://ccm.net/faq/21396-excel-a-macro-to-create-new-workbook-and-copy-data

I am hoping to replicate what that linked macro does, but I need to pull the data from one column based on how the data begins. This is because several of the data are only differentiated later in the number.

For example,

A B
XYZ 601.004.005
ABC 601.004.005.01
DEF 601.005.001

I want to create a new file for all rows with BEGINS with data in B1, thereby capturing the data in B1 and B2, and a new filefor all rows containing the data in B3.

I hope that makes sense. Thank you very much!

2 replies

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Jun 28, 2014 at 09:02 AM
When you say it should begin. Why cant i say B3 begins with 601 also. So I guess question is what criteria one should use to say this is different and this still starts with
0
Burt_Macklin Posts 4 Registration date Friday June 27, 2014 Status Member Last seen July 17, 2014
Jul 1, 2014 at 12:05 PM
The identifier is this number in column B. So in the example I gave, I need to be able to take every row that begins with "601.004.005" in column B and save them into a new workbook.

Then I need to do the same for every row that begins with "601.004.005.01" in column B.

Then finally to do the same for every row that begins with "601.005.001" in column B.

So even though B1 and B2 begin the same, the additional numbers in B2 differentiate it from B1.

Does that make sense?

Thank you very much,
0
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Jul 5, 2014 at 09:40 AM
I am still not clear
In B column you had these values
601.004.005
601.004.005.01
601.005.001

You said B1 and B2 start with same number but all three start with 601. So why not all three. And if actually meant that we should look for pattern of XXX.YYY.ZZZ to say that number starts. What I am trying to understand is till what point you look to say this number also starts with same

So
601.004.005
601.004.005.01
601.005.001
601.004.9999 (does this go with B1 and B2?)
601.004.005.01.99 (will this go with B1 and b2)
0
Burt_Macklin Posts 4 Registration date Friday June 27, 2014 Status Member Last seen July 17, 2014
Jul 7, 2014 at 09:23 AM
Oh I understand. Sorry I'm not intentionally trying to be unclear. Let me just lay out the actual numbers I have to work with:

601.004.0003%
601.004.0010%
601.004.0019%
601.004.0027%
601.011%
601.007%
601.004.0002.017%
601.004.0002.014%
601.004.0006%
601.004.0008.006%
601.004.0008.007%
601.004.0008.008%
601.004.0008.009%
601.004.0008.010%
601.004.0008.011%
601.004.0008.012%
601.004.0021%
601.004.0022%
601.004.0026%
601.004.0018%
601.004.0024%

These are all the unique identifiers, for lack of a better word. On the actual spreadsheet, all of these numbers look like AAA.BBB.CCCC.DDD.EEE and it varies as to which part of the number (i.e. CCCC or DDD, etc) is different.

For the above the % means that it doesn't matter what numbers appear after the %. So what I need is for everything that "begins" with 601.004.0003 to be copied into new spreadsheet and saved. Same thing for 601.004.0010 and so on down the line.

Thanks very much for your help.
0
Burt_Macklin Posts 4 Registration date Friday June 27, 2014 Status Member Last seen July 17, 2014
Jul 17, 2014 at 10:40 AM
Any ideas?
0