mercredi 22 novembre 2017

If Condition Not Working using variable

I have assigned all condition to a variable(a) and using the same variable in condition, but is is not working, when we copy all the criteria given to the variable and use it directly in the condition it is working.

a = "Trim(Mid(""" & sNextLine & """," & UserForm1.TextBox5.Text & "," & UserForm1.TextBox6.Text & ")) " & con & " " & """" & UserForm1.TextBox8.Text & """"

If a Then

a = b

end if

where sNextLine ="061001 00100 0002017001 001.00 00004001 61A00 000000000", UserForm1.TextBox5.Text=1, UserForm1.TextBox6.Text=3,con ="=", UserForm1.TextBox8.Text="061"

Please Help me with this. if any problem in the question or code please ignore. i'm new here.

Thank You

Aucun commentaire:

Enregistrer un commentaire