newbieMark
08-08-2014, 11:33 AM
1207812078I have a raw data export with 9,000 rows.
I would like to have a VB/Macro to look thru it and find a key word at beginning of a row, then copy that full cell value to column B and do so for as many rows below it as necessary to map, so to speak, each subsequent row to the appropriate heading.
It's easier to show a picture: see below.
note that each person is the "heading" so to speak and their attributes are underneath. Not that they all have different attributes.
I imagine that the VB will look for "name" and then paste the full cell value to column B, and keep doing so until it hits a blank (sometimes there's 1 blank, sometimes there's 2 blanks) OR until it finds a new "name" and then do the same.
HERES MY RAW DATA DUMP SNIPPET x9,000 rows
I WANT A VB TO DO THIS
name Tom Johnson
name Tom Johnson
height 5'7"
name Tom Johnson
sex Male
name Tom Johnson
kids 3
name Tom Johnson
irrelevant data
irrelevant data
irrelevant data
name Jane Doe
name Jane Doe
height 5'7"
name Jane Doe
sex Female
name Jane Doe
weight 140
name Jane Doe
kids 3
name Jane Doe
irrelevant data
name Jack Doe
name Jack Doe
height 5'7"
name Jack Doe
job IT Manager
name Jack Doe
weight 190
name Jack Doe
kids 3
name Jack Doe
sex Male
name Jack Doe
I would like to have a VB/Macro to look thru it and find a key word at beginning of a row, then copy that full cell value to column B and do so for as many rows below it as necessary to map, so to speak, each subsequent row to the appropriate heading.
It's easier to show a picture: see below.
note that each person is the "heading" so to speak and their attributes are underneath. Not that they all have different attributes.
I imagine that the VB will look for "name" and then paste the full cell value to column B, and keep doing so until it hits a blank (sometimes there's 1 blank, sometimes there's 2 blanks) OR until it finds a new "name" and then do the same.
HERES MY RAW DATA DUMP SNIPPET x9,000 rows
I WANT A VB TO DO THIS
name Tom Johnson
name Tom Johnson
height 5'7"
name Tom Johnson
sex Male
name Tom Johnson
kids 3
name Tom Johnson
irrelevant data
irrelevant data
irrelevant data
name Jane Doe
name Jane Doe
height 5'7"
name Jane Doe
sex Female
name Jane Doe
weight 140
name Jane Doe
kids 3
name Jane Doe
irrelevant data
name Jack Doe
name Jack Doe
height 5'7"
name Jack Doe
job IT Manager
name Jack Doe
weight 190
name Jack Doe
kids 3
name Jack Doe
sex Male
name Jack Doe