Hi,
I have this data
Sheet 2
<tbody>
</tbody>
And I want to do it this way.
Report
<tbody>
</tbody>
========================================================
<tbody>
</tbody>
I have my code here, And I got stuck I don't know what comes next after this code. Is there any clean and neat way to come up with this output?
Please Help Me
I have this data
Sheet 2
Name | Date | Working Hours | Task | Status | AND SO ON... |
Sam | 01/01/2015 | 9.00 | Help Pat | OK | |
Sam | 01/02/2015 | 9.00 | Cook | OK | |
Sam | 01/03/2015 | 9.00 | Walking | PENDING | |
Sam | 01/04/2015 | 9.00 | Watch TV | OK | |
PAT | 01/01/2015 | 2.00 | Study | OK | |
PAT | 01/02/2015 | 2.00 | Clean | OK | |
PAT | 01/03/2015 | 1.00 | Read | OK | |
PAT | 01/04/2015 | 9.00 | Help Mom | OK | |
BEA | 01/01/2015 | 1.00 | Do Homework | OK | |
BEA | 01/02/2015 | 2.00 | Help Dad | OK | |
BEA | 01/03/2015 | 2.00 | Drive | OK | |
BEA | 01/04/2015 | 8.00 | Watch Movie | PENDING | |
AND SO ON... |
<tbody>
</tbody>
And I want to do it this way.
Report
Name | 01/01/2015 | 01/02/2015 | 01/03/2015 | 01/04/2015 | AND SO ON... |
Sam | 9.00 | 9.00 | 9.00 | 9.00 | |
Pat | 2.00 | 2.00 | 1.00 | 9.00 | |
Bea | 1.00 | 2.00 | 2.00 | 8.00 | |
AND SO ON... |
<tbody>
</tbody>
========================================================
Sam | Pat | Bea | AND SO ON... | |||
Help Pat | 9.00 | Study | 2.00 | Do Homework | 1.00 | |
Cook | 9.00 | Clean | 2.00 | Help Dad | 2.00 | |
Walking | 9.00 | Read | 1.00 | Drive | 2.00 | |
Watch TV | 9.00 | Help Mom | 9.00 | Watch Movie | 8.00 | |
AND SO ON.... |
<tbody>
</tbody>
I have my code here, And I got stuck I don't know what comes next after this code. Is there any clean and neat way to come up with this output?
Code:
Worksheets("Report").Select
Sheets("Sheet2").Columns(12).Copy Destination:=Sheets("Report").Columns(1)
Range("A:A").RemoveDuplicates Columns:=1, Header:=xlYes
NameRow = Range("A" & Rows.Count).End(xlUp).Row
Sheets("Sheet2").Columns(2).Copy Destination:=Sheets("Report").Columns(2)
Range("B:B").RemoveDuplicates Columns:=1, Header:=xlNo
DateRow = Range("B" & Rows.Count).End(xlUp).Row
Worksheets("Report").Range("B:B").Sort _
Key1:=Range("B1"), _
Order1:=xlAscending, _
Header:=xlYes
Dim ResDate() As String
Dim I As Integer
ReDim ResDate(2 To DateRow)
For I = 2 To DateRow
ResDate(I) = Format(Cells(I, 2), "mm-dd-yyyy")
Cells(I, 2) = ""
Cells(1, I) = ResDate(I)
Next
Dim ResName() As String
Dim K As Integer
ReDim ResName(2 To NameRow)
For K = 2 To NameRow
ResName(K) = Cells(K, 1)
Next
Please Help Me
Last edited: