Necesito optimizar esto
Private Sub CommandButton2_Click()
Dim fecha As Date, mes As String
fecha = "1/1/" & Sheets("QUADRANT").Range("A9")
fechaFin = "31/12/" & Sheets("QUADRANT").Range("A9")
posA = 0
modA = 0
posB = 0
modB = 0
posC = 1
modC = 1
posD = 0
modD = 0
posE = 0
moddE = 0
posF = 0
modF = 0
For i = fecha To fechaFin
y = 4 + 7 * Month(i)
x = 2 + Day(i)
De aqui hasta el final es la parte que mas me interesa
For j = 0 To 5
If Sheets("QUADRANT").Cells(y + j, x).Value = "R" Then
If j = 0 Then
Sheets("R'S DE TURNOS").Cells(14, 8 + posA).Value = Day(i)
posA = posA + 1
modA = modA + 1
If modA = 5 Then
modA = 0
posA = posA + 6
End If
ElseIf j = 1 Then
Sheets("R'S DE TURNOS").Cells(24, 8 + posB).Value = Day(i)
posB = posB + 1
modB = modB + 1
If modB = 5 Then
modB = 0
posB = posB + 6
End If
ElseIf j = 2 Then
Sheets("R'S DE TURNOS").Cells(34, 8 + posC).Value = Day(i)
posC = posC + 1
modC = modC + 1
If modC = 5 Then
modC = 0
posC = posC + 6
End If
ElseIf j = 3 Then
Sheets("R'S DE TURNOS").Cells(44, 8 + posD).Value = Day(i)
posD = posD + 1
modD = modD + 1
If modD = 5 Then
modD = 0
posD = posD + 6
End If
ElseIf j = 4 Then
Sheets("R'S DE TURNOS").Cells(54, 8 + posE).Value = Day(i)
posE = posE + 1
moddE = moddE + 1
If moddE = 5 Then
moddE = 0
posE = posE + 6
End If
ElseIf j = 5 Then
Sheets("R'S DE TURNOS").Cells(64, 8 + posF).Value = Day(i)
posF = posF + 1
modF = modF + 1
If modF = 5 Then
modF = 0
posF = posF + 6
End If
End If
End If
Next j
Next i
End Sub
(Ignorar) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas interdum tempus nisl sit amet ultrices. Nulla pretium euismod sem, ac vulputate nunc. Aenean sagittis mollis dolor nec gravida.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas interdum tempus nisl sit amet ultrices. Nulla pretium euismod sem, ac vulputate nunc. Aenean sagittis mollis dolor nec gravida.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas interdum tempus nisl sit amet ultrices. Nulla pretium euismod sem, ac vulputate nunc. Aenean sagittis mollis dolor nec gravida.