1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub Macro1()
Dim PlageStricte As Range, PlageCasse As Range, PlagePartiel As Range
Dim MaCell As Range, PremCell As Range
With Worksheets(1).Cells
Set MaCell = .Find(What:="France", After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If Not MaCell Is Nothing Then
Set PremCell = MaCell
Do
If StrComp(MaCell.Value, "France", vbBinaryCompare) = 0 Then
MsgBox "correspondance stricte"
ElseIf StrComp(MaCell.Value, "France", vbTextCompare) = 0 Then
MsgBox "correspondance sans casse"
Else
MsgBox "correspondance partielle"
End If
Set MaCell = .FindNext(MaCell)
Loop While Not MaCell Is Nothing And Not MaCell.Address = PremCell.Address
End If
End With
End Sub |
Partager