XL 2016 Vba , plusieurs feuilles

Guismo33

XLDnaute Occasionnel
Bonjour a tous,
une Vba pour un fichier avec une feuil pilote "Principal".
1° ligne d'info a prendre : 5 a 36
2°nom de feuil 1 a 31
Vba simplifier pour prendre la première ligne avec 1° feuil, 2° ligne avec 2° feuil etc.
exemple Vba mais ne fonctionne pas.

Dim lig As Long
for i=1 to 31
With Sheets(i) ' feuille
lig = .Cells(Rows.Count, "A").End(xlUp).Row + 1
.Cells(lig, "A").Value = Date
For j = 15 To 23
If ActiveSheet.Cells(5, j) <= 3 Then
.Cells(lig, j - 13) = ActiveSheet.Cells(5, j)
End If
If ActiveSheet.Cells(5, j) <= 4 Then
.Cells(lig, j - 4) = ActiveSheet.Cells(5, j)
End If
Next j

End With
next i

Merci

Bien à vous
 

Discussions similaires

Réponses
11
Affichages
286

Statistiques des forums

Discussions
312 182
Messages
2 086 004
Membres
103 086
dernier inscrit
jcreant