Hi I am trying to do index match Loop through Columns first and then Rows with multiple criteria in VBA
My Source data is like:
<tbody>
</tbody>
And my Destination Data should be like this:
<tbody>
</tbody>
Where as i am using Code with Worksheet function
With Destination
.Range("B2:D4").Clear
For R = 2 To 4
For C = 2 To UBound(Arr2, 2)
.Cells(R, C) = .Application.WorksheetFunction.Index(Source.Range("A2:C30000"), _
.Application.WorksheetFunction.Match(.Cells(R, 1) & CDate(.Cells(1, C)), WS1.Range("B2:B30000") & WS1.Range("A2:A30000"), 0), 3)
Next C
Next R
.Activate
End With
End Sub
it is giving me Type Mismatch Error. Any help??
I am using Excel 2016 on Mac.
My Source data is like:
Date | email ID | Attendance Status |
22/08/18 | Bob22@tiptop.com | Present |
22/08/18 | Milan@tiptop.com | Present |
22/08/18 | Samuel@tiptop.com | Present |
23/08/18 | Bob22@tiptop.com | Planned Leave |
23/08/18 | Milan@tiptop.com | Present |
23/08/18 | Samuel@tiptop.com | Present |
24/08/18 | Bob22@tiptop.com | Present |
24/08/18 | Milan@tiptop.com | Unplanned Leave |
<tbody>
</tbody>
And my Destination Data should be like this:
Email IDs | 22/08/18 | 23/08/18 | 24/08/18 |
Bob22@tiptop.Com | |||
Milan@tiptop.com | |||
Samuel@tiptop.com |
<tbody>
</tbody>
Where as i am using Code with Worksheet function
With Destination
.Range("B2:D4").Clear
For R = 2 To 4
For C = 2 To UBound(Arr2, 2)
.Cells(R, C) = .Application.WorksheetFunction.Index(Source.Range("A2:C30000"), _
.Application.WorksheetFunction.Match(.Cells(R, 1) & CDate(.Cells(1, C)), WS1.Range("B2:B30000") & WS1.Range("A2:A30000"), 0), 3)
Next C
Next R
.Activate
End With
End Sub
it is giving me Type Mismatch Error. Any help??
I am using Excel 2016 on Mac.