Afficher un message
Vieux 22/03/2008, 14h54   #7 (permalink)
ftho
XLDnaute Occasionel
 
Avatar de ftho
 
Date d'inscription: janvier 2008
Localisation: Bxl
Messages: 210
Par défaut Re : [VBA] -jeu casse-tête: aide pour évaluer String (pour calcul)

Bonjour,

Une piste (loin d'être complète)
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Val, x, i
Val = Target.Value
If Right(Val, 2) = ")!" Then
    For i = 1 To Len(Val) - 2
        If Mid(Val, i, 1) = "!" Then
        x = x + Application.WorksheetFunction.Fact(Mid(Val, i - 1, 1))
        End If
    Next
Target.Offset(0, 1) = Application.WorksheetFunction.Fact(x)
End If
End Sub
ftho est déconnecté   Réponse avec citation