Dim maj% 'mémorise la variable
Sub MFC()
'se lance par Ctrl+M
Application.ScreenUpdating = False
Cells.FormatConditions.Delete 'RAZ
Range("A1", Me.UsedRange).Select
Selection.FormatConditions.Add xlExpression, Formula1:="=TROUVE(""?"";A1)" 'pour version française
Selection.FormatConditions(1).Interior.ColorIndex = 6 'jaune
Application.Goto [A1], True 'cadrage
End Sub
Sub Recherche()
'se lance par Ctrl+R
Dim r As Range
Set r = Cells.Find("~?", ActiveCell, xlValues, xlPart)
If r Is Nothing Then MsgBox "Aucun ""?"" trouvé...": Exit Sub
r.Select 'sélectionne la cellule trouvée
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim t$, i%
t = "aceinouy" 'liste des caractères de remplacement
With ListBox1
.Visible = False
If InStr(ActiveCell, "?") Then
.Clear
For i = 1 To Len(t): .AddItem Mid(t, i, 1): Next 'crée la liste
.Top = ActiveCell.Top
.Left = ActiveCell(1, 2).Left
.Visible = True
End If
End With
End Sub
Private Sub ListBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
maj = Shift 'mémorisation
ListBox1.Selected(Int(Y * ListBox1.ListCount / ListBox1.Height)) = True 'mise en surbrillance du caractère
End Sub
Private Sub Listbox1_GotFocus()
ActiveCell = Replace(ActiveCell, "?", IIf(maj, UCase(ListBox1), ListBox1), , 1)
ActiveCell.Activate 'enlève le focus
If InStr(ActiveCell, "?") = 0 Then ListBox1.Visible = False
End Sub