Dreamfusion
Messages postés23Date d'inscriptiondimanche 29 décembre 2002StatutMembreDernière intervention15 mars 2004
-
30 janv. 2003 à 17:23
cs_philoup
Messages postés20Date d'inscriptionmardi 17 juin 2003StatutMembreDernière intervention22 juin 2003
-
17 juin 2003 à 11:08
Hello tlm,
J'ai un chtit problème, j'expose une partie du code :
For i = 1 To MaCombo.Ubound
If MaCombo(i).Text = "Texte" Then
maphrase = maphrase & i & ", "
'XX Met en mémoire la combo défaillante
incorrect = incorrect + 1
End If
Next i
If incorrect > 1 Then
MsgBox maphrase, vbCritical + vbOKOnly, "Erreur de sélection !"
Exit Sub
ElseIf incorrect = 1 Then
....
End if
Mon problème réside dans 'maphrase'. En effet je voudrai terminer 'maphrase' par un point. Dans ce cas-ci, elle se terminera toujours par une virgule. Comment je peux aller chercher la derniere virgule et la remplacer par un point, etant donné que 'maphrase" est de taille variable ? Devrai-je utiliser un tableau pour isoler les index des combos ? Bref je sais pas...
cs_philoup
Messages postés20Date d'inscriptionmardi 17 juin 2003StatutMembreDernière intervention22 juin 2003 17 juin 2003 à 10:49
sinon tu fais:
For i = 1 To MaCombo.Ubound
>
> If MaCombo(i).Text = "Texte" Then
> maphrase = maphrase & i
if i <> macombo.ubound then
maphrase = maphrase & ","
else 'on en est au dernier
maphrase = maphrase & "."
end if
>
> 'XX Met en mémoire la combo défaillante
> incorrect = incorrect + 1
> End If
>
> Next i
cs_philoup
Messages postés20Date d'inscriptionmardi 17 juin 2003StatutMembreDernière intervention22 juin 2003 17 juin 2003 à 11:08
maphrase2= Replace(maphrase, ",", ".")
qui met dans "maphrase2" maphrase terminée par un point à la place d'une virgule
maphrase= maphrase2
qui met "maphrase2" dans "maphrase"