Find and Findnext code help

SteelNuttz

New Member
Joined
Oct 11, 2016
Messages
23
Hey guys, I have a long list of contact names and addresses, none of which have a unique identifier. I need a way to pull the contact name and address info from the list, and paste it into a new tab so that I can have all of the contact names listed as column headers.

an example of two contacts might look like this:

ContactJohn Doe
Address 11 Main St
Address 2City, St Zip
ContactJane Doe
Address 12 Main St
Address 2City, St Zip

<tbody>
</tbody>

So far I can only envision doing a "Find" in Column A for "Contact", then offsetting 1 column, selecting Activecell and the 2 cells below it, and pasting in a new tab. I can get the first one to go, I'm not sure how to continue the loop to "FindNext" and do the same thing.

The number of times I'll need to do this is variable, so it could be 1 contact, it could be 10 contacts.

Any help would be appreciated, thanks!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If your data are somewhat regular (meaning that you may have some contacts with 4 lines and some with 3 lines) then the following might work to make a column of individual lines which you can then filter / copy into a new sheet. If the data aren't this regular, then you could still do something similar, but you'd need more conditionals in the extraction formula:

ABCD
1ContactJohn DoeJohn Doe / 1 Main St / City, St Zip
2Address 11 Main St
3Address 2City, St Zip
4ContactJane DoeJane Doe / 2 Main St / City, St Zip / Country
5Address 12 Main St
6Address 2City, St Zip
7Address 3Country

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
D1=IF( A1 = "Contact", B1 & " / " & B2 & " / " & B3 & IF( A4 <> "Contact", " / " & B4, ""), "")
D2=IF( A2 = "Contact", B2 & " / " & B3 & " / " & B4 & IF( A5 <> "Contact", " / " & B5, ""), "")
D3=IF( A3 = "Contact", B3 & " / " & B4 & " / " & B5 & IF( A6 <> "Contact", " / " & B6, ""), "")
D4=IF( A4 = "Contact", B4 & " / " & B5 & " / " & B6 & IF( A7 <> "Contact", " / " & B7, ""), "")
D5=IF( A5 = "Contact", B5 & " / " & B6 & " / " & B7 & IF( A8 <> "Contact", " / " & B8, ""), "")
D6=IF( A6 = "Contact", B6 & " / " & B7 & " / " & B8 & IF( A9 <> "Contact", " / " & B9, ""), "")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,492
Members
448,967
Latest member
visheshkotha

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