commande REPLACE

B

bruno

Guest
salut à tous

j'utilise la fonction replace dans les lignes de code suivantes


voici la ligne de code
Dim condition,nouveau As String
Sub CommandButton1_Click()
If condition Then MsgBox (condition) Else MsgBox ("erreur")

'ici je cherche a avoir dans condition 4=4 mais jai "4=4" ?
'peut on supprime les "" ?
End Sub

Private Sub CommandButton2_Click()
condition = ""
nouveau=""
nouveau= Replace(ComboBox1 = ComboBox2, "=", ComboBox3)

' ex : pour combobox1=4 combobox2=4 combobox3==
MsgBox (condition)
End Sub

donc mon probleme peut il etre resolu ?


End Sub
 
P

pyrof

Guest
Bonjour,

En fait tu veux vérifier la condition sur combobox3
Je ne sais pas comment transformer une chaine(=) en opérateur de condition.

Voici une autre vision de la chose, qui je l'espère te conviendra


Sub CommandButton1_Click()

Select Case ComboBox3
Case "="
If ComboBox1 = ComboBox2 Then
MsgBox ComboBox1 & "=" & ComboBox2
Else
MsgBox ComboBox1 & "<>" & ComboBox2
End If
Case ">"
If ComboBox1 > ComboBox2 Then
MsgBox ComboBox1 & ">" & ComboBox2
Else
MsgBox ComboBox1 & "<" & ComboBox2
End If
End Select

End Sub


A+-
 

Statistiques des forums

Discussions
312 971
Messages
2 094 045
Membres
105 926
dernier inscrit
Odyssea