List of Names: Extract Address like info into individual row list (eg. Husbands/Wives/Singles)

legogeek

New Member
Joined
Mar 1, 2011
Messages
28
I'm sure this has been asked before - if so please direct me.

I have Fields: LastName,FirstName,Spouse,Position,Spouse Position

It's a list that also includes people that are singles.

Just looking for direction how to keep my original list AND elsewhere to have a list that derives and splits each person and their position into their own row (ie. bringing in the LastName for the wife). I am open to VBA ideas. I am hoping that the original list can be updated which will automatically update this new list as well.

Take this
[TABLE="width: 500"]
<tbody>[TR]
[TD]LastName[/TD]
[TD]FirstName[/TD]
[TD]Spouse[/TD]
[TD]Position[/TD]
[TD]Spouse Position[/TD]
[/TR]
[TR]
[TD]FlintStone[/TD]
[TD]Fred[/TD]
[TD]Wilma[/TD]
[TD]Quarry Operator[/TD]
[TD]Home Manager[/TD]
[/TR]
[TR]
[TD]FlintStone[/TD]
[TD]Bambam[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Lightyear[/TD]
[TD]Buzz[/TD]
[TD][/TD]
[TD]Star Commander[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mouse[/TD]
[TD]Mickey[/TD]
[TD]Minnie[/TD]
[TD]Disney Ambassador[/TD]
[TD]Bow Distributor[/TD]
[/TR]
</tbody>[/TABLE]

To get this - that can continually update from the is list above.
[TABLE="width: 500"]
<tbody>[TR]
[TD]LastName[/TD]
[TD]FirstName[/TD]
[TD]Position[/TD]
[/TR]
[TR]
[TD]FlintStone[/TD]
[TD]Fred[/TD]
[TD]Quarry Operator[/TD]
[/TR]
[TR]
[TD]FlintStone[/TD]
[TD]Wilma[/TD]
[TD]Home Manager[/TD]
[/TR]
[TR]
[TD]FlintStone[/TD]
[TD]Bambam[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Lightyear[/TD]
[TD]Buzz[/TD]
[TD]Star Commander[/TD]
[/TR]
[TR]
[TD]Mouse[/TD]
[TD]Mickey[/TD]
[TD]Disney Ambassador[/TD]
[/TR]
[TR]
[TD]Mouse[/TD]
[TD]Minnie[/TD]
[TD]Bow Distributor[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Put the following code in the events of the destination sheet

Code:
Private Sub Worksheet_Activate()
  Dim sh1 As Worksheet, sh2 As Worksheet, i As Long, j As Long
  Application.ScreenUpdating = False
  Set sh1 = Sheets("Sheet1")
  Set sh2 = Sheets("Sheet2")
  sh2.Rows("2:" & Rows.Count).Clear
  j = 2
  For i = 2 To sh1.Range("A" & Rows.Count).End(xlUp).Row
    sh2.Cells(j, "A") = sh1.Cells(i, "A")
    sh2.Cells(j, "B") = sh1.Cells(i, "B")
    sh2.Cells(j, "C") = sh1.Cells(i, "D")
    j = j + 1
    If sh1.Cells(i, "C") <> "" Then
      sh2.Cells(j, "A") = sh1.Cells(i, "A")
      sh2.Cells(j, "B") = sh1.Cells(i, "C")
      sh2.Cells(j, "C") = sh1.Cells(i, "E")
      j = j + 1
    End If
  Next
End Sub

SHEET EVENT
Right click the tab of the destination sheet you want this to work, select view code and paste the code into the window that opens up.

Update the source sheet, when you activate the destination sheet automatically all the information will be updated.
 
Upvote 0

Forum statistics

Threads
1,224,746
Messages
6,180,705
Members
452,994
Latest member
Janick

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