Macro "commence par"

Résolu/Fermé
allias - 5 févr. 2010 à 10:56
 allias - 5 févr. 2010 à 11:23
Bonjour,

J'ai un problème d'écriture de macro : si je fais cette macro ça marche

If Application.Workbooks("xxxx.xls").Worksheets("Feuil1").Range("A" & i).Value = "toto" Then ...

mais je voudrais la modifier et que ce ne soit plus la cellule = toto mais commence par toto.

Est-ce que quelqu'un peut m'aider?
Merci
A voir également:

2 réponses

tompols Messages postés 1219 Date d'inscription jeudi 29 juillet 2004 Statut Contributeur Dernière intervention 25 novembre 2013 460
5 févr. 2010 à 10:59
salut,
commence par : If left(Application.Workbooks("xxxx.xls").Worksheets("Feuil1").Range("A" & i).Value,4) = "toto" Then
tant qu'on y est pour contient "toto" : if instr(Application.Workbooks("xxxx.xls").Worksheets("Feuil1").Range("A" & i).Value, "toto") then....
0
Ca marche, merci!
0