I am trying to use a vb that I have all ready I need to pull info from this sheet. and put it on another sheet. The info I need is Agent Name cell b1, Date cells b3 and b17, and the totals m15, and m30. I also have the end results for you to see. Below you will see the sheet and the VB I was trying to use. Can someone please help.
<colgroup><col span="16"></colgroup><tbody>
</tbody>
vba coding
The End result:
<colgroup><col><col><col></colgroup><tbody>
</tbody>
A | B | C | D | E | F | G | H | I | J | K | L | M | N | ||
1 | Agent: 50336 Adrovel, Mayra | ||||||||||||||
2 | |||||||||||||||
3 | Date: 5/13/15 | ||||||||||||||
4 | |||||||||||||||
5 | Scheduled Activities | Scheduled Time | Actual Time | Min. in Adherence | Min. out Adherence | Percent in Adherence | +/- Min. in Conformance | ||||||||
6 | |||||||||||||||
7 | |||||||||||||||
8 | AUX 0 | 0:00 | 0:01 | 0 | 0 | 0.00% | 1 | ||||||||
9 | AUX 1: Break | 0:15 | 0:14 | 0 | 15 | 0.00% | -1 | ||||||||
10 | AUX 3: Meeting | 0:00 | 0:39 | 0 | 0 | 0.00% | 39 | ||||||||
11 | AUX 8:Special Projec | 2:00 | 3:31 | 95 | 25 | 79.17% | 91 | ||||||||
12 | |||||||||||||||
13 | Logoff | 4:30 | 4:35 | 267 | 3 | 98.89% | 5 | ||||||||
14 | Logon | 2:15 | 0:00 | 0 | 135 | 0.00% | -135 | ||||||||
15 | Total | 9:00 | 9:00 | 362 | 178 | 67.04% | 0 | ||||||||
16 | |||||||||||||||
17 | Date: 5/19/15 | ||||||||||||||
18 | |||||||||||||||
19 | Scheduled Activities | Scheduled Time | Actual Time | Min. in Adherence | Min. out Adherence | Percent in Adherence | +/- Min. in Conformance | ||||||||
20 | |||||||||||||||
21 | |||||||||||||||
22 | AUX 0 | 0:00 | 0:01 | 0 | 0 | 0.00% | 1 | ||||||||
23 | AUX 1: Break | 0:15 | 0:39 | 15 | 0 | 100.00% | 24 | ||||||||
24 | AUX 2: Lunch | 1:00 | 0:00 | 0 | 60 | 0.00% | -60 | ||||||||
25 | AUX 8:Special Projec | 0:00 | 3:45 | 0 | 0 | 0.00% | 225 | ||||||||
26 | |||||||||||||||
27 | Logoff | 4:15 | 4:35 | 240 | 15 | 94.12% | 20 | ||||||||
28 | Adherence | ||||||||||||||
29 | Logon | 3:30 | 0:00 | 0 | 210 | 0.00% | -210 | ||||||||
30 | Total | 9:00 | 9:00 | 255 | 285 | 47.22% | 0 | ||||||||
31 | |||||||||||||||
32 | Total for 50336 Adrovel, Mayra | ||||||||||||||
33 | |||||||||||||||
34 | |||||||||||||||
35 | Scheduled Activities | Scheduled Time | Actual Time | Min. in Adherence | Min. out Adherence | Percent in Adherence | +/- Min. in Conformance |
<colgroup><col span="16"></colgroup><tbody>
</tbody>
vba coding
Code:
Sub REPORT()
For MY_ROWS = 1 To Range("C" & Rows.Count).End(xlUp).Row
If Not (IsEmpty(Range("C" & MY_ROWS).Value)) Then
MY_AGENT = Right(Range("C" & MY_ROWS).Value, Len(Range("C" & MY_ROWS).Value) - 7)
For MY_NEXT_ROWS = MY_ROWS + 1 To Range("C" & MY_ROWS).End(xlDown).Row
If Left(Range("D" & MY_NEXT_ROWS).Value, 4) = "Date" Then
MY_DATE = Right(Range("D" & MY_NEXT_ROWS).Value, Len(Range("D" & MY_NEXT_ROWS).Value) - 12)
MY_ACTIVITY = Range("D" & MY_NEXT_ROWS + 1).Offset(4, 4).Value
MY_LENGTH = Range("D" & MY_NEXT_ROWS + 1).Offset(12, 12).Value
With Sheets("Sheet2")
.Range("D" & Rows.Count).End(xlUp).Offset(1, 0).Value = MY_AGENT
.Range("E" & Rows.Count).End(xlUp).Offset(1, 0).Value = MY_DATE
.Range("F" & Rows.Count).End(xlUp).Offset(1, 0).Value = MY_ACTIVITY
.Range("G" & Rows.Count).End(xlUp).Offset(1, 0).Value = MY_LENGTH
End With
End If
Next MY_NEXT_ROWS
End If
Next MY_ROWS
End Sub
The End result:
Agent | Date | Score |
50336 Adrovel, Mayra | 5/13/15 | 67.04% |
50336 Adrovel, Mayra | 5/13/15 | 47.22% |
<colgroup><col><col><col></colgroup><tbody>
</tbody>