I tried the following code
[VBA]
Union(.Range(.Cells(2, 8), .Cells(periods + 1, 8)), .Range(periods + 3, 8, 2 * periods + 3, 8)).Select
Selection.NumberFormat = "hh:mm,@"
[/VBA]
as well as a not so sophisticated version
[VBA]
.Range(.Cells(2, 8).Cells(2 * periods + 3, 8)).Select
Selection.NumberFormat = "hh:mm,@"
[/VBA]
and in both cases the area gets selected BUT the format doesn't stay (or isn't changed - i don't know which. Why and how do i kill it?
On a very similar subject - i try to copy a range and paste it in INCLUDING the formatting. What i do is the following.
[VBA]
With ActiveSheet
.Range(.Cells(1, 1), .Cells(periods, 1)).Select
Selection.Copy
.Range(.Cells(2, 8), .Cells(periods + 1, 8)).Select
.Paste
.Range(.Cells(periods + 3, 8), .Cells(2 * periods + 3, 8)).Select
.Paste
.Range(.Cells(2, 8).Cells(2 * periods + 3, 8)).Select
Selection.NumberFormat = "hh:mm,@"
End With
[/VBA]
For some reason (which i'm sure i'll be quickly made aware of soon) the formatting dosn't follow the copy process. How do i enforce it?