Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Set derlign = Range("B" & Rows.count).End(xlUp)
  2. 'MsgBox ("Dernière ligne " & derlign & " !")
  3. Set r1 = Range("A2:A100")
  4. Set r2 = Range("B2:B100")
  5. For N = 2 To r2.Rows.count
  6. If r2.Cells(N - 1, 1) = r2.Cells(N, 1) Then
  7. r1.Cells(N, 1) = r1.Cells(N - 1, 1)
  8. Else
  9. r1.Cells(N, 1) = r1.Cells(N - 1, 1) + 1
  10. End If
  11. Next N
  12. End Sub`
  13.  
  14. N° REF
  15. 1 305-77-871
  16. 2 402-88-920
  17. 2 402-88-920
  18. 3 406-55-585
  19. 3 406-55-585
  20. 3 406-55-585
  21. 4 404-11-885
  22. 4 404-11-885
  23. 4
  24. 4
  25. 4
  26. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement