Need to create a macro to insert row from sheet1 into sheet2

[Closed]
Report
Posts
1
Registration date
Tuesday May 16, 2017
Status
Member
Last seen
May 17, 2017
-
Hello,

I need to create a macro that will insert data from sheet1 into sheet2 based on the value in column D. The number of rows of data will vary each time the Macro is run.
Example:
Sheet1 contains hierarchy codes and titles
D E
1 01000 Staff
2 02000 Admin
3 03000 Training
Sheet2 contains:
A B C D E
ACTIVITY BIN SEQ HIERARCHY TITLE
1 3239A 0121109 01010 01000 BOSS MAN
2 3239A 3816159 01020 01000 SUPERVISOR
3 3239A 0005032 02030 02000 WORKER
4 3239A 0827199 01035 02000 MANAGER
5 3239A 3669414 10010 03000 SERVICES SPEC
6 3239A 0808225 10020 03000 ADM ASST
7 3239A 3669416 10030 03000 TECH

I need to insert the row from sheet1 into sheet2 each time the HIERARCHY number changes.
Results would look like this:
A B C D E
ACTIVITY BIN SEQ HIERARCHY TITLE
1 01000 Staff
2 3239A 0121109 01010 01000 BOSS MAN
3 3239A 3816159 01020 01000 SUPERVISOR
4 02000 Admin
5 3239A 0005032 02030 02000 WORKER
6 3239A 0827199 01035 02000 MANAGER
7 03000 Training
8 3239A 3669414 10010 03000 SERVICES SPEC
9 3239A 0808225 10020 03000 ADM ASST
10 3239A 3669416 10030 03000 TECH