Excel 2007
Windows XP
Happy Monday!
I would appreciate help in creating a macro to format my report from looking like this:
<tbody>
</tbody>
To looking like this:
Rows that are blank, or contain Phone and or Break are being deleted
<tbody>
</tbody>
In seaching the forum if found this code
It results in:
<tbody>
</tbody>
Which is almost there except I need another column with the names and deleting rows.
Thank you for reading!
Windows XP
Happy Monday!
I would appreciate help in creating a macro to format my report from looking like this:
Employee Name | Activity Name |
Nathan | Manager: Ron |
7/22/12 | |
Phone | |
Break | |
Phone | |
Lunch | |
Actvity1 | |
Break | |
Actvity1 | |
Break | |
Activity3 | |
7/23/12 | |
Phone | |
Break | |
Activity3 | |
Lunch | |
Phone | |
Break | |
Phone | |
Break | |
Phone | |
7/24/12 | |
Actvity1 | |
Break | |
Phone | |
Lunch | |
Activity3 | |
Break | |
Phone | |
Break | |
Phone | |
Gina | Manager: Jewel |
7/23/12 | |
Phone | |
Phone | |
Break | |
Phone | |
Lunch | |
Phone | |
1x1 | |
Phone | |
Break | |
Phone | |
7/24/12 | |
Phone | |
Break | |
Phone | |
Lunch | |
Activity2 | |
Break | |
Phone | |
7/25/12 | |
Phone | |
Activity2 | |
Break | |
Phone | |
Lunch | |
Phone | |
Meeting | |
Break | |
Phone | |
7/26/12 | |
Phone | |
Phone | |
Break | |
Phone | |
Lunch | |
Activity2 | |
Break | |
Phone | |
Morena | Manager: Sean |
7/23/12 | |
Phone | |
Activity3 | |
Break | |
Phone | |
Lunch | |
Phone | |
1x1 | |
Phone | |
Break | |
Phone | |
7/24/12 | |
Phone | |
Break | |
Phone | |
Lunch | |
Phone | |
Break | |
Phone | |
7/25/12 | |
Phone | |
Phone | |
Break | |
Phone | |
Lunch | |
Phone | |
Meeting | |
Break | |
Phone |
<tbody>
</tbody>
To looking like this:
Rows that are blank, or contain Phone and or Break are being deleted
Activity Name | ||
Nathan | 7/22/12 | Lunch |
Nathan | 7/22/12 | Actvity1 |
Nathan | 7/22/12 | Actvity1 |
Nathan | 7/22/12 | Activity3 |
Nathan | 7/23/12 | Activity3 |
Nathan | 7/23/12 | Lunch |
Nathan | 7/24/12 | Actvity1 |
Nathan | 7/24/12 | Lunch |
Nathan | 7/24/12 | Activity3 |
Gina | 7/23/12 | Lunch |
Gina | 7/23/12 | 1x1 |
Gina | 7/24/12 | Lunch |
Gina | 7/24/12 | Activity2 |
Gina | 7/25/12 | Activity2 |
Gina | 7/25/12 | Lunch |
Gina | 7/25/12 | Meeting |
Gina | 7/26/12 | Lunch |
Gina | 7/26/12 | Activity2 |
Morena | 7/23/12 | Activity3 |
Morena | 7/23/12 | Lunch |
Morena | 7/23/12 | 1x1 |
Morena | 7/24/12 | Lunch |
Morena | 7/25/12 | Lunch |
Morena | 7/25/12 | Meeting |
<tbody>
</tbody>
In seaching the forum if found this code
Code:
Option Explicit
Sub FillInAdjuster()
' hiker95, 08/05/2012
' http://www.mrexcel.com/forum/showthread.php?651583-Auto-fill-variable-cells-with-information-from-above
Dim r As Long, lr As Long
Application.ScreenUpdating = False
lr = Cells.Find("*", , xlValues, xlWhole, xlByRows, xlPrevious, False).Row
For r = 2 To lr Step 1
If Cells(r, 1) = "" Then Cells(r, 1).Value = Cells(r - 1, 1).Value
Next r
Application.ScreenUpdating = True
End Sub
It results in:
Employee Name | Activity Name |
Nathan | Manager: Ron |
7/22/12 | |
7/22/2012 | Phone |
7/22/2012 | Break |
7/22/2012 | Phone |
7/22/2012 | Lunch |
7/22/2012 | Actvity1 |
7/22/2012 | Break |
7/22/2012 | Actvity1 |
7/22/2012 | Break |
7/22/2012 | Activity3 |
7/22/2012 | |
7/22/2012 | |
7/23/12 | |
7/23/2012 | Phone |
7/23/2012 | Break |
7/23/2012 | Activity3 |
7/23/2012 | Lunch |
7/23/2012 | Phone |
7/23/2012 | Break |
7/23/2012 | Phone |
7/23/2012 | Break |
7/23/2012 | Phone |
7/23/2012 | |
7/23/2012 |
<tbody>
</tbody>
Which is almost there except I need another column with the names and deleting rows.
Thank you for reading!