1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Sub test()
Dim Init As Boolean
Dim MyRange As Range
Dim L As Long
Set MyRange = ActiveSheet.UsedRange
Debug.Print "Sur une colonne"
For L = 1 To MyRange.Rows.Count
Debug.Print Highlander(Init, MyRange(L, 1))
Next
Init = False
Debug.Print "********************"
Debug.Print "Sur une plage colonne"
For L = 1 To MyRange.Rows.Count
Debug.Print Highlander(Init, ActiveSheet.Range(MyRange(L, 1), MyRange(L, 2)))
Next
Init = False
Debug.Print "********************"
Debug.Print "Sur 2 colonnes"
For L = 1 To MyRange.Rows.Count
Debug.Print Highlander(Init, MyRange(L, 1), MyRange(L, 3))
Next
Init = False
Debug.Print "********************"
Debug.Print "Sur deux plage colonne"
For L = 1 To MyRange.Rows.Count
Debug.Print Highlander(Init, ActiveSheet.Range(MyRange(L, 1), MyRange(L, 2)), ActiveSheet.Range(MyRange(L, 3), MyRange(L, 4)))
Next
Init = False
Debug.Print "********************"
Debug.Print "Sur une plage colonne"
For L = 1 To MyRange.Rows.Count
If Highlander(Init, ActiveSheet.Range(MyRange(L, 1), MyRange(L, 2))) = True Then MsgBox "Doublon"
Next
End Sub |
Partager