Sub BuildHierarchyEntity()
Dim RowId As Long
' APAC all segments and brands from row 2005 to row 2802
' Sheet Entity in this AG - Case IH Wholegoods
' CE goes from line 2329 to 2727
' select those that are meaningful for the segment based on the columns
'Layer 2 - AG
'Layer 2 - CV
'Layer 2 - CE
'Layer 2 - PT
'in the output replace regexp LegEnt:[0-9]+\|Country: with nothing
For RowId = 2005 To 2802
' is base entity
Cells(RowId, 100).Value = Cells(RowId, 1).Value
' code
Cells(RowId, 101).Value = Cells(RowId, 39).Value
' default currency
Cells(RowId, 102).Value = Cells(RowId, 40).Value
' country
Cells(RowId, 103).Value = Cells(RowId, 45).Value
' description
Cells(RowId, 104).Value = Cells(RowId, 51).Value
Next RowId
End Sub