Sub test1()
Dim a, i&, n&, m&, arr, j&
j = 0
m = Range("A" & Rows.Count).End(xlUp).Row
With Range("A2", Range("A" & Rows.Count).End(xlUp)).Resize(m * 7, 30)
a = .Value
For i = 1 To UBound(a, 1)
If a(i, 1) = "" Then GoTo oops
n = n + 1
a(i + j, 14) = "DATES"
arr = Split(a(i, 5), "/")
If Len(arr(1)) = 1 Then
a(i + 1 + j, 14) = "'0" & arr(1) & " " & UCase(MonthName(arr(0), True)) & " " & arr(2) & " /"
Else
a(i + 1 + j, 14) = "'" & arr(1) & " " & UCase(MonthName(arr(0), True)) & " " & arr(2) & " /"
End If
a(i + 2 + j, 14) = "'/"
a(i + 3 + j, 14) = a(i, 2)
a(i + 4 + j, 14) = " " & a(i, 1)
a(i + 4 + j, 15) = a(i, 3)
a(i + 4 + j, 15) = a(i, 3)
a(i + 4 + j, 16) = a(i, 4)
a(i + 4 + j, 17) = a(i, 6)
a(i + 4 + j, 18) = a(i, 7)
a(i + 4 + j, 19) = a(i, 8)
a(i + 4 + j, 20) = a(i, 9)
a(i + 4 + j, 21) = a(i, 10)
a(i + 4 + j, 22) = a(i, 11)
a(i + 4 + j, 23) = a(i, 12)
a(i + 4 + j, 24) = "'/"
a(i + 5 + j, 14) = "'/"
If a(i, 6) = "" Then a(i + 4 + j, 17) = "'1*"
If a(i, 7) = "" Then a(i + 4 + j, 18) = "'1*"
If a(i, 8) = "" Then a(i + 4 + j, 19) = "'1*"
If a(i, 9) = "" Then a(i + 4 + j, 20) = "'1*"
If a(i, 10) = "" Then a(i + 4 + j, 21) = "'1*"
If a(i, 11) = "" Then a(i + 4 + j, 22) = "'1*"
If a(i, 12) = "" Then a(i + 4 + j, 23) = "'1*"
j = j + 6
Next
oops:
.Value = a
Columns("N:Y").Select
Selection.Cut
Sheets("Results").Select
Range("A1").Select
ActiveSheet.Paste
Columns("B:K").HorizontalAlignment = xlCenter
Range("A1").Select
End With
End Sub
Bookmarks