Private Sub CommandButton1_Click()
Dim Arr, dArr1, dArr2, dArr3, ilastrow As Long, I As Long, K, M, N, J, C, A, B, E, D, F, H, G, T, L
Application.ScreenUpdating = False
With Sheets("V191-schedule")
Arr = .Range("A9", .Range("A65000")).End(3).Resize(, 10).Value2
For I = 1 To UBound(Arr)
If Arr(I, 1) Like UCase(II) Then
K = I
End If
Next I
For M = 1 To UBound(Arr)
If Arr(M, 1) Like UCase(III) Then
N = M
End If
Next M
For J = 1 To UBound(Arr)
If Arr(J, 1) Like UCase(IV) Then
C = J
End If
Next J
End With
ReDim dArr1(1 To UBound(Arr), 1 To 10)
For E = 1 To K - 2
For B = 2 To K - 1
For A = 1 To 10
dArr1(E, A) = Arr(B, A)
Next A
Next B
Next E
ReDim dArr2(1 To UBound(Arr), 1 To 10)
For D = 1 To N - K - 1
For C = K + 1 To N - 1
For T = 1 To 10
dArr1(D, T) = Arr(C, T)
Next T
Next C
Next D
ReDim dArr3(1 To UBound(Arr), 1 To 10)
For F = 1 To C - N - 1
For H = N + 1 To C - 1
For T = 1 To 10
dArr1(F, T) = Arr(H, T)
Next T
Next H
Next F
With Sheets("THI")
If .Range("A65000").End(3).Row > 3 Then
.Range("A4", .Range("A65000").End(3)).Resize(, 10).Borders.LineStyle = 0
.Range("A4", .Range("A65000").End(3)).Resize(, 10).ClearContents
End If
If E Then
.Range("A4").Resize(E, 10) = dArr1
.Range("A4").Resize(E, 10).Borders.LineStyle = 1
.Range("A4").Resize(E, 10).Borders(xlInsideHorizontal).Weight = xlHairline
End If
End With
Application.ScreenUpdating = True
End Sub