J'ai créé une macro pour incrémenter dans les lignes de la colonne A des entier suivant deux conditions.
Pb quand j'excecute ma macro depuis (outils/macro/macro.../excecuter) il me trouve une erreur 400
Merci
Ci joint mon code :
Sub NumFiche()
Dim i As Integer
Dim NbLignesTab As Integer
Dim NumFiche As Integer
NumFiche = 1
NbLignesTab = ActiveSheet.UsedRange.Rows.Count
Cells(2, A) = NumFiche
For i = 3 To NbLignesTab
If Cells(i, F) Cells(i - 1, F) And Cells(i, P) Cells(i - 1, P) Then
Cells(i, A) = NumFiche
Else
NumFiche = NumFiche + 1
End If
Next i
End Sub
vérifie le format de Cells dans l'aide excel
par ex Cells(2, A) plante --> facile de déterminer pq.
Remplace Cells(2,1) est normalement cela doit fonctionner
Cells(RowIndex, ColumnIndex) --> Index est un nombre