Erreur 1004
Fermé
tetro14
Messages postés
8
Date d'inscription
lundi 8 août 2016
Statut
Membre
Dernière intervention
15 août 2016
-
15 août 2016 à 14:43
ThauTheme Messages postés 1442 Date d'inscription mardi 21 octobre 2014 Statut Membre Dernière intervention 29 juillet 2022 - 15 août 2016 à 16:35
ThauTheme Messages postés 1442 Date d'inscription mardi 21 octobre 2014 Statut Membre Dernière intervention 29 juillet 2022 - 15 août 2016 à 16:35
1 réponse
ThauTheme
Messages postés
1442
Date d'inscription
mardi 21 octobre 2014
Statut
Membre
Dernière intervention
29 juillet 2022
160
15 août 2016 à 16:35
15 août 2016 à 16:35
Bonjour Tetro, bonjour el forum,
Tu oublies souvent le point faisant référence au With devant certains Range ou Cells. Ton code modifié mais non testé :
Tu oublies souvent le point faisant référence au With devant certains Range ou Cells. Ton code modifié mais non testé :
Sub Formule()
Dim DernLigne As Long
Dim lastcolumn As Integer
With Sheets("Liste")
.Cells(5, 3).Formula = .Cells(1, 2).Formula
DernLigne = .Range("A" & Rows.Count).End(xlUp).Row
.Cells(5, 3).AutoFill Destination:=.Range("C5:C" & DernLigne)
.Cells(5, 5).Formula = .Cells(2, 2).Formula
.Cells(5, 5).AutoFill Destination:=.Range("E5:E" & DernLigne)
End With
With Sheets("Actifs")
lastcolumn = .Cells(5, Columns.Count).End(xlToLeft).Column
.Range("D7").AutoFill Destination:=.Range(.Cells(7, 4), .Cells(7, lastcolumn))
End With
With Sheets("Geo")
lastcolumn = .Cells(5, Columns.Count).End(xlToLeft).Column
.Cells(7, 4).AutoFill Destination:=.Range(.Cells(7, 4), .Cells(7, lastcolumn))
End With
End Sub