S
Sam Commar
I would really appreciate help with creating a macro.
I have source data which looks like this. So the source date is always 5
columns.
Deltek 10 1 88 E 880
Deltek 13 1 50.5 E 505
Deltek 13 5 16.5 E 247.47
Deltek 14 1 96.5 E 880
Deltek 35 1 8 E 110
Deltek 5 1 36 E 176
Deltek 62 1 9 E 110
Deltek 68 1 13 E 130
Deltek 9 1 32 E 320
This data is extracted every 15 days. The number of rows vary every 15 days
but the columns are constant.
I want to create a macro which will translate the data with some headers and
some if then statements and put it on another sheet.
The results would be in 10 columns with the info as as follows:
Header Info
Col1 Col2 Col3 Col4
Col5 Col6 Col 7 COl8
Col9 Col10
CO CODE BATCH ID FILE # REG HOURS O/T HOURS REG
EARNINGS HOURS 3 CODE HOURS 3 AMOUNT EARNINGS 3 CODE EARNINGS 3 AMOUNT
Detail info would be populated as below and the if then statements would
refrence the source data.
Col1 Col2 Col3
Col4 Col5 Col6
EP7(Constant) BATCH01(Constatnt) =IF(B2<51,1000+B2,B2)
=IF(C2=1,D2," ") =IF(C2=5,D2," ") Blank
Col7
=IF(OR(C2={2,3,4,10}),C2," ")
Col8 Col9
Col10
=IF(OR(C2={2,3,4,10}),D2," ")
=IF(OR(C2={"8c",8,"8b","8d",60,"7W","7T"}),C2," ")
=IF(OR(C2={"8c",8,"8b","8d",60,"7W","7T"}),F2," ")
So the data would look like this based on the application of the above
mentioned items and if then statements.
CO CODE BATCH
ID
FILE # REG HOURS O/T HOURS REG EARNINGS HOURS 3 CODE HOURS 3
AMOUNT EARNINGS 3 CODE EARNINGS 3AMOUNT
EP7 Batch01 1010 88
EP7 Batch01 1013 50.5
EP7 Batch01 1013 16.5
EP7 Batch01 1014 96.5
EP7 Batch01 1035 8
EP7 Batch01 1005 36
EP7 Batch01 62 9
EP7 Batch01 68 13
EP7 Batch01 1009 32
I have source data which looks like this. So the source date is always 5
columns.
Deltek 10 1 88 E 880
Deltek 13 1 50.5 E 505
Deltek 13 5 16.5 E 247.47
Deltek 14 1 96.5 E 880
Deltek 35 1 8 E 110
Deltek 5 1 36 E 176
Deltek 62 1 9 E 110
Deltek 68 1 13 E 130
Deltek 9 1 32 E 320
This data is extracted every 15 days. The number of rows vary every 15 days
but the columns are constant.
I want to create a macro which will translate the data with some headers and
some if then statements and put it on another sheet.
The results would be in 10 columns with the info as as follows:
Header Info
Col1 Col2 Col3 Col4
Col5 Col6 Col 7 COl8
Col9 Col10
CO CODE BATCH ID FILE # REG HOURS O/T HOURS REG
EARNINGS HOURS 3 CODE HOURS 3 AMOUNT EARNINGS 3 CODE EARNINGS 3 AMOUNT
Detail info would be populated as below and the if then statements would
refrence the source data.
Col1 Col2 Col3
Col4 Col5 Col6
EP7(Constant) BATCH01(Constatnt) =IF(B2<51,1000+B2,B2)
=IF(C2=1,D2," ") =IF(C2=5,D2," ") Blank
Col7
=IF(OR(C2={2,3,4,10}),C2," ")
Col8 Col9
Col10
=IF(OR(C2={2,3,4,10}),D2," ")
=IF(OR(C2={"8c",8,"8b","8d",60,"7W","7T"}),C2," ")
=IF(OR(C2={"8c",8,"8b","8d",60,"7W","7T"}),F2," ")
So the data would look like this based on the application of the above
mentioned items and if then statements.
CO CODE BATCH
ID
FILE # REG HOURS O/T HOURS REG EARNINGS HOURS 3 CODE HOURS 3
AMOUNT EARNINGS 3 CODE EARNINGS 3AMOUNT
EP7 Batch01 1010 88
EP7 Batch01 1013 50.5
EP7 Batch01 1013 16.5
EP7 Batch01 1014 96.5
EP7 Batch01 1035 8
EP7 Batch01 1005 36
EP7 Batch01 62 9
EP7 Batch01 68 13
EP7 Batch01 1009 32