Vb Basic Addition Concatenation Instead Of Addition
Hi
My VB skills are very rudimentary......................
I've created some "named sources" and want to add then together
[attachment=1156:Script Assistant (Multi-Line Script)_2014-08-27_07-50-52.png]
[attachment=1157:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_07-54-03.png]
[attachment=1158:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_07-54-54.png]
But M1 and M2 are concatenated (4+25 = 425)
[attachment=1159:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_07-57-23.png]
But if I change the formula to "Value = 0 + M1 + M2" It works?
[attachment=1159:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_07-57-23.png]
[attachment=1160:BarTender Automation - Calf Pellets - Premium PCS.btw __2014-08-27_08-00-30.png]
Thoughts?
-
you have to convert them to integers first. Your DIM statements aren't working because the objects already exist. Try value = cInt(M1) + cInt(M2) instead. Or even better value = cint(Format.NamedSubStrings("M1").Value) + cint(Format.NamedSubStrings("M2").Value) 0 -
Thanks
That worked (first option) didn't try the second one
0
Please sign in to leave a comment.
Comments
2 comments