I have this question:
Create a Sub with any combination of nested loops. This nested loop should take the baby girl names input (below) and print out every possible combination. These input names will need to appear in your workbook somewhere. Print out the combinations in the workbook itself.
Input
[TABLE="class: cms_table, align: center"]
<tbody>[TR]
[TD]First names[/TD]
[TD]Middle names[/TD]
[/TR]
[TR]
[TD]Penelope[/TD]
[TD]Jill[/TD]
[/TR]
[TR]
[TD]Gwyneth[/TD]
[TD]Diane[/TD]
[/TR]
[TR]
[TD]Alice[/TD]
[TD]Heidi[/TD]
[/TR]
[TR]
[TD]Anna[/TD]
[TD]Lilly[/TD]
[/TR]
[TR]
[TD]Aurora[/TD]
[TD]Victoria[/TD]
[/TR]
</tbody>[/TABLE]
I have been able to get Penelope paired with all the middle names, but I can't figure out how to pair the rest of the first names. I don't know how to offset the active cell to the second first name and so on. this is what I have so far:
Sub part2()
Dim combination As String
Dim fName As String
Dim mName As String
Range("A1").Activate
fName = ActiveCell.Value
Do Until IsEmpty(ActiveCell)
mName = ActiveCell.Offset(0, 1).Value
combination = fName & " " & mName
ActiveCell.Offset(0, 3) = combination
ActiveCell.Offset(1, 0).Activate
Loop
Create a Sub with any combination of nested loops. This nested loop should take the baby girl names input (below) and print out every possible combination. These input names will need to appear in your workbook somewhere. Print out the combinations in the workbook itself.
Input
[TABLE="class: cms_table, align: center"]
<tbody>[TR]
[TD]First names[/TD]
[TD]Middle names[/TD]
[/TR]
[TR]
[TD]Penelope[/TD]
[TD]Jill[/TD]
[/TR]
[TR]
[TD]Gwyneth[/TD]
[TD]Diane[/TD]
[/TR]
[TR]
[TD]Alice[/TD]
[TD]Heidi[/TD]
[/TR]
[TR]
[TD]Anna[/TD]
[TD]Lilly[/TD]
[/TR]
[TR]
[TD]Aurora[/TD]
[TD]Victoria[/TD]
[/TR]
</tbody>[/TABLE]
I have been able to get Penelope paired with all the middle names, but I can't figure out how to pair the rest of the first names. I don't know how to offset the active cell to the second first name and so on. this is what I have so far:
Sub part2()
Dim combination As String
Dim fName As String
Dim mName As String
Range("A1").Activate
fName = ActiveCell.Value
Do Until IsEmpty(ActiveCell)
mName = ActiveCell.Offset(0, 1).Value
combination = fName & " " & mName
ActiveCell.Offset(0, 3) = combination
ActiveCell.Offset(1, 0).Activate
Loop