InaCell
Board Regular
- Joined
- Feb 2, 2010
- Messages
- 189
Hi Glenn<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Data<o></o>
<o></o>
Expected result<o></o>
<o></o>
This was my sample code to get the first 3 columns how I wanted it. But doesn't get the multiple marriage instance.<o></o>
<o></o>
Thanks again<o></o>
<o> </o>
Data<o></o>
HTML:
<html><head><title>Excel Jeanie HTML</title></head><body>[RANGE=cls:xl2bb-100][XR][XH=cs:9]Excel Workbook[/XH][/XR][XR][XH][/XH][XH]A[/XH][XH]B[/XH][XH]C[/XH][XH]D[/XH][XH]E[/XH][XH]F[/XH][XH]G[/XH][XH]H[/XH][/XR][XR][XH]1[/XH][XD=h:c|fw:b]Male SURNAME[/XD][XD=h:r]1[/XD][XD][/XD][XD=h:c|fw:b]Son SURNAME[/XD][XD=h:r]14[/XD][XD][/XD][XD=h:c|fw:b|bc:ff0000]Jane SURNAME[/XD][XD=h:r]52[/XD][/XR][XR][XH]2[/XH][XD=h:c|fs:i]b.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][/XR][XR][XH]3[/XH][XD=h:c|fs:i]d.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]m.[/XD][XD][/XD][XD][/XD][XD][/XD][XD][/XD][/XR][XR][XH]4[/XH][XD=h:c|fs:i]bur.[/XD][XD][/XD][XD][/XD][XD=h:c|fw:b|bc:ff0000]Jane GIRL[/XD][XD=h:r]15[/XD][XD][/XD][XD=h:c|fw:b]James SURNAME[/XD][XD=h:r]53[/XD][/XR][XR][XH]5[/XH][XD=h:c|fs:i]m.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][/XR][XR][XH]6[/XH][XD=h:c|fw:b|bc:ff0000]Female MAIDEN[/XD][XD=h:r]2[/XD][XD][/XD][XD=h:c|fs:i]d.[/XD][XD][/XD][XD][/XD][XD][/XD][XD][/XD][/XR][XR][XH]7[/XH][XD=h:c|fs:i]b.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]bur.[/XD][XD][/XD][XD][/XD][XD=h:c|fw:b|bc:ff0000]Julia SURNAME[/XD][XD=h:r]54[/XD][/XR][XR][XH]8[/XH][XD=h:c|fs:i]d.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]m.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][/XR][XR][XH]9[/XH][XD=h:c|fs:i]bur.[/XD][XD][/XD][XD][/XD][XD=h:c|fw:b|bc:ff0000]Anne JONES[/XD][XD=h:r]16[/XD][XD][/XD][XD=fs:i][/XD][XD][/XD][/XR][XR][XH]10[/XH][XD=h:c|fs:i]m.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][XD][/XD][XD=fs:i][/XD][XD][/XD][/XR][XR][XH]11[/XH][XD=h:c|fw:b|bc:ff0000]Female SMITH[/XD][XD=h:r]3[/XD][XD][/XD][XD][/XD][XD][/XD][XD][/XD][XD][/XD][XD][/XD][/XR][XR][XH]12[/XH][XD=h:c|fs:i]b.[/XD][XD][/XD][XD][/XD][XD=h:c|fw:b|bc:ff0000]Karen SURNAME[/XD][XD=h:r]17[/XD][XD][/XD][XD=h:c|fw:b]Tom DOE[/XD][XD=h:r]55[/XD][/XR][XR][XH]13[/XH][XD=h:c|fs:i]d.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][/XR][XR][XH]14[/XH][XD=h:c|fs:i]bur.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]m.[/XD][XD][/XD][XD][/XD][XD][/XD][XD][/XD][/XR][XR][XH]15[/XH][XD][/XD][XD][/XD][XD][/XD][XD=h:c|fw:b]John DOE[/XD][XD=h:r]18[/XD][XD][/XD][XD=h:c|fw:b|bc:ff0000]Amy DOE[/XD][XD=h:r]56[/XD][/XR][XR][XH]16[/XH][XD][/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][XD][/XD][XD=h:c|fs:i]b.[/XD][XD][/XD][/XR][XR][XH=cs:9][RANGE][XR][XD]Testing[/XD][XH][/XH][/XR][/RANGE][/XH][/XR][/RANGE]
</body></html>
Expected result<o></o>
HTML:
<html><head><title>Excel Jeanie HTML</title></head><body>[RANGE=cls:xl2bb-100][XR][XH=cs:7]Excel Workbook[/XH][/XR][XR][XH][/XH][XH]A[/XH][XH]B[/XH][XH]C[/XH][XH]D[/XH][XH]E[/XH][XH]F[/XH][/XR][XR][XH]1[/XH][XD=h:l]ID[/XD][XD=h:l]Name[/XD][XD=h:l]Sex[/XD][XD=h:l]Father[/XD][XD=h:l]Mother[/XD][XD=h:l]Spouse[/XD][/XR][XR][XH]2[/XH][XD=h:r]1[/XD][XD=h:l]Male SURNAME[/XD][XD=h:l]M[/XD][XD][/XD][XD][/XD][XD=h:r]2[/XD][/XR][XR][XH]3[/XH][XD=h:r]1[/XD][XD=h:l]Male SURNAME[/XD][XD=h:l]M[/XD][XD][/XD][XD][/XD][XD=h:r]3[/XD][/XR][XR][XH]4[/XH][XD=h:r]2[/XD][XD=h:l]Female MAIDEN[/XD][XD=h:l]F[/XD][XD][/XD][XD][/XD][XD=h:r]1[/XD][/XR][XR][XH]5[/XH][XD=h:r]3[/XD][XD=h:l]Female SMITH[/XD][XD=h:l]F[/XD][XD][/XD][XD][/XD][XD=h:r]1[/XD][/XR][XR][XH]6[/XH][XD=h:r]14[/XD][XD=h:l]Son SURNAME[/XD][XD=h:l]M[/XD][XD=h:r]1[/XD][XD=h:r]2[/XD][XD=h:r]15[/XD][/XR][XR][XH]7[/XH][XD=h:r]14[/XD][XD=h:l]Son SURNAME[/XD][XD=h:l]M[/XD][XD=h:r]1[/XD][XD=h:r]2[/XD][XD=h:r]16[/XD][/XR][XR][XH]8[/XH][XD=h:r]15[/XD][XD=h:l]Jane GIRL[/XD][XD=h:l]F[/XD][XD][/XD][XD][/XD][XD=h:r]14[/XD][/XR][XR][XH]9[/XH][XD=h:r]16[/XD][XD=h:l]Anne JONES[/XD][XD=h:l]F[/XD][XD][/XD][XD][/XD][XD=h:r]14[/XD][/XR][XR][XH]10[/XH][XD=h:r]17[/XD][XD=h:l]Karen SURNAME[/XD][XD=h:l]F[/XD][XD=h:r]1[/XD][XD=h:r]2[/XD][XD=h:r]17[/XD][/XR][XR][XH]11[/XH][XD=h:r]18[/XD][XD=h:l]John DOE[/XD][XD=h:l]M[/XD][XD][/XD][XD][/XD][XD=h:r]16[/XD][/XR][XR][XH]12[/XH][XD=h:r]52[/XD][XD=h:l]Jane SURNAME[/XD][XD=h:l]F[/XD][XD=h:r]14[/XD][XD=h:r]15[/XD][XD][/XD][/XR][XR][XH]13[/XH][XD=h:r]53[/XD][XD=h:l]James SURNAME[/XD][XD=h:l]M[/XD][XD=h:r]14[/XD][XD=h:r]15[/XD][XD][/XD][/XR][XR][XH]14[/XH][XD=h:r]54[/XD][XD=h:l]Julia SURNAME[/XD][XD=h:l]F[/XD][XD=h:r]14[/XD][XD=h:r]15[/XD][XD][/XD][/XR][XR][XH]15[/XH][XD=h:r]55[/XD][XD=h:l]Tom DOE[/XD][XD=h:l]M[/XD][XD=h:r]17[/XD][XD=h:r]16[/XD][XD][/XD][/XR][XR][XH]16[/XH][XD=h:r]56[/XD][XD=h:l]Amy DOE[/XD][XD=h:l]F[/XD][XD=h:r]17[/XD][XD=h:r]16[/XD][XD][/XD][/XR][XR][XH=cs:7][RANGE][XR][XD]List[/XD][XH][/XH][/XR][/RANGE][/XH][/XR][/RANGE]
</body></html>
This was my sample code to get the first 3 columns how I wanted it. But doesn't get the multiple marriage instance.<o></o>
Code:
Sub TEST()
Dim x As Long, a As Long, b As Long, c As Long, d As Long
Dim e As Long, f As Long
'x = sets last used row for range
'a = source Col, b = source Row
'c = dest Row, d = dest Col
'e = source Col, f = source Row (Source of Individual Id #)
Application.ScreenUpdating = False ' speed up code for macro
Application.Calculation = xlCalculationManual ' speed up code for macro
c = 1<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]For a = 1 To 7 Step 3 'selects columns A D G
c = c 'begins Row 1
d = 1 'begins in Col A
x = Sheets("Testing").Cells(Rows.Count, a).End(xlUp).Row ' sets last row of source range
For b = 1 To x 'source range starts at row 1
If Sheets("Testing").Cells(b, a) <> "" Then ' excludes blanks in source range
If Sheets("Testing").Cells(b, a).Font.Bold Then 'if bold text
c = c + 1 'dest Row +1 (next row)
d = 1 'Begins in dest Col A
e = a + 1
f = b
Sheets("List").Cells(c, d) = Cells(f, e)
d = d + 1 'dest next Col
Sheets("List").Cells(c, d) = Cells(b, a)
'Copies Bold data from source to destination
d = d + 1 'dest next Col
'================================
'This section puts in Sex (M/F)
If Sheets("Testing").Cells(b, a).Interior.ColorIndex > 2 Then
Sheets("List").Cells(c, d).Value = "F"
Else
Sheets("List").Cells(c, d).Value = "M"
'Copies Sex data from source to destination
End If
'================================
'This section puts in parent Id #
'================================
'This section puts in spouse Id #
Else
'================================
End If
End If
Next b 'goes to next Row in source sheet
Next a 'goes to next Col in source sheet
Application.Calculation = xlCalculationAutomatic ' set back to normal
Application.ScreenUpdating = True ' set back to normal
MsgBox "Complete" 'Alert, macro finished
End Sub
Thanks again<o></o>
<o> </o>