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
LastNameFirstNameSpousePositionSpouse Position
FlintStoneFredWilmaQuarry OperatorHome Manager
FlintStoneBambam
LightyearBuzzStar Commander
MouseMickeyMinnieDisney AmbassadorBow Distributor

<tbody>
</tbody>

To get this - that can continually update from the is list above.
LastNameFirstNamePosition
FlintStoneFredQuarry Operator
FlintStoneWilmaHome Manager
FlintStoneBambam
LightyearBuzzStar Commander
MouseMickeyDisney Ambassador
MouseMinnieBow Distributor

<tbody>
</tbody>
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
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,214,431
Messages
6,119,462
Members
448,899
Latest member
maplemeadows

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