I do a LOT of scheduling people at my job. Kronos spits a nasty excel sheet with 1000's of rows and about 40 columns. I've got created enough macros to where it fine tunes it to what you see below BUT I would like to do a few more things to really make it so I can print these schedules for staff and not spend hours a week on them. List of things I seem to be incapable of doing:
1) Creating a macro that helps find a date and then merges+centers A:I in that one row. Here is what I am playing with but each time I run it it merges and centers vertically as well as horizontally.
Sub DateMergeCenter()
With Sheets(1)
For Each rCell In .Range(.Cells(1, "A"), .Cells(.Rows.Count, "A").End(xlUp))
If IsDate(rCell) Then
If rCell >= K2 Then
Lastrow = Cells(Rows.Count, "D").End(xlUp).Row
For i = 1 To Lastrow
If rCell >= K2 Then
.Range("A" & i & ":I" & i).Merge
End If
End If
Next rCell
End With
End Sub
2) Next I would like to insert a page break above each date so only one day prints per page instead of going in and adding hundreds of page breaks.
Any help on this would be so absolutely amazing and appreciated. As you can probably tell: I've only been using VBA for about 3 days. Lots of learning to do.
1) Creating a macro that helps find a date and then merges+centers A:I in that one row. Here is what I am playing with but each time I run it it merges and centers vertically as well as horizontally.
Sub DateMergeCenter()
With Sheets(1)
For Each rCell In .Range(.Cells(1, "A"), .Cells(.Rows.Count, "A").End(xlUp))
If IsDate(rCell) Then
If rCell >= K2 Then
Lastrow = Cells(Rows.Count, "D").End(xlUp).Row
For i = 1 To Lastrow
If rCell >= K2 Then
.Range("A" & i & ":I" & i).Merge
End If
End If
Next rCell
End With
End Sub
2) Next I would like to insert a page break above each date so only one day prints per page instead of going in and adding hundreds of page breaks.
Any help on this would be so absolutely amazing and appreciated. As you can probably tell: I've only been using VBA for about 3 days. Lots of learning to do.