Bonjour a tous,
je ne suis pas très fort en Vba , mais j'ai réussi a faire celle ci qui es un peut longue.
je souhaiterais savoir si ont peut améliorer cette Vba.
Sub REUNION1()
Dim i As Integer, lig As Long, lig2 As Long
With Sheets("R1").Select
lig = Cells(3, Columns.Count).End(xlToLeft).Column + 1
lig2 = Cells(38, Columns.Count).End(xlToLeft).Column + 1
For i = 1 To 6
Cells(3 + i, lig).Value = Cells(3 + i, 24).Value
Cells(10 + i, lig).Value = Cells(10 + i, 24).Value
Cells(17 + i, lig).Value = Cells(17 + i, 24).Value
Cells(24 + i, lig).Value = Cells(24 + i, 24).Value
Cells(31 + i, lig).Value = Cells(31 + i, 24).Value
Cells(38 + i, lig).Value = Cells(38 + i, 24).Value
Cells(45 + i, lig).Value = Cells(45 + i, 24).Value
Cells(38 + i, lig2).Value = Cells(38 + i, 24).Value
Cells(45 + i, lig2).Value = Cells(45 + i, 24).Value
Next i
Cells(3, lig) = Range("a1").Value
Cells(38, lig2) = Range("a1").Value
End With
Range("Tiercé").ClearContents
Range("compteur") = Range("compteur") + 1
End Sub
merci a vous
bien à vous
je ne suis pas très fort en Vba , mais j'ai réussi a faire celle ci qui es un peut longue.
je souhaiterais savoir si ont peut améliorer cette Vba.
Sub REUNION1()
Dim i As Integer, lig As Long, lig2 As Long
With Sheets("R1").Select
lig = Cells(3, Columns.Count).End(xlToLeft).Column + 1
lig2 = Cells(38, Columns.Count).End(xlToLeft).Column + 1
For i = 1 To 6
Cells(3 + i, lig).Value = Cells(3 + i, 24).Value
Cells(10 + i, lig).Value = Cells(10 + i, 24).Value
Cells(17 + i, lig).Value = Cells(17 + i, 24).Value
Cells(24 + i, lig).Value = Cells(24 + i, 24).Value
Cells(31 + i, lig).Value = Cells(31 + i, 24).Value
Cells(38 + i, lig).Value = Cells(38 + i, 24).Value
Cells(45 + i, lig).Value = Cells(45 + i, 24).Value
Cells(38 + i, lig2).Value = Cells(38 + i, 24).Value
Cells(45 + i, lig2).Value = Cells(45 + i, 24).Value
Next i
Cells(3, lig) = Range("a1").Value
Cells(38, lig2) = Range("a1").Value
End With
Range("Tiercé").ClearContents
Range("compteur") = Range("compteur") + 1
End Sub
merci a vous
bien à vous