Hi guys, I'm trying to make an app using visual studio 2010, I'm really new at this and I'm having a problem so I'm seeking for help here.
I have this excel formula that will calculate a 6 Digit code from a 11 digit serial number.
The excel is pretty old and it consts of math operations such as
RIGHT, LEFT, MID and POWER I managed to "translate" that to
Microsoft.VisualBasic.Right, Microsoft.VisualBasic.Left, Microsoft.VisualBasic.Mid and Math.Pow
but i'm not sure if i did it right, since is not giving me the result i'm looking for, instead of a 6 digit number is giving me something like this: 9.9E+52
I appreciate if you guys point me where my error is thanks.
Here's the code I made for the vB
and this is the excel one
Thanks in advanced guys.
I have this excel formula that will calculate a 6 Digit code from a 11 digit serial number.
The excel is pretty old and it consts of math operations such as
RIGHT, LEFT, MID and POWER I managed to "translate" that to
Microsoft.VisualBasic.Right, Microsoft.VisualBasic.Left, Microsoft.VisualBasic.Mid and Math.Pow
but i'm not sure if i did it right, since is not giving me the result i'm looking for, instead of a 6 digit number is giving me something like this: 9.9E+52
I appreciate if you guys point me where my error is thanks.
Here's the code I made for the vB
VB.NET:
Microsoft.VisualBasic.Right((Math.Pow(2, 5 + (Microsoft.VisualBasic.Left((Microsoft.VisualBasic.Left(txtESN.Text, 3)), 1) + Microsoft.VisualBasic.Right(Microsoft.VisualBasic.Left(txtESN.Text, 3), 1) + Microsoft.VisualBasic.Mid(Microsoft.VisualBasic.Left(txtESN.Text, 3), 2, 1))) - 1) * ((Microsoft.VisualBasic.Right(txtESN.Text, 3)) + 199) * (23 + (Microsoft.VisualBasic.Left((Microsoft.VisualBasic.Right(txtESN.Text, 8)), 1) + Microsoft.VisualBasic.Right((Microsoft.VisualBasic.Right(txtESN.Text, 8)), 1) + Microsoft.VisualBasic.Mid((Microsoft.VisualBasic.Right(txtESN.Text, 8)), 3, 1) + Microsoft.VisualBasic.Mid((Microsoft.VisualBasic.Right(txtESN.Text, 8)), 5, 1) + Microsoft.VisualBasic.Mid((Microsoft.VisualBasic.Right(txtESN.Text, 8)), 7, 1) + Microsoft.VisualBasic.Mid((Microsoft.VisualBasic.Right(txtESN.Text, 8)), 2, 1) + Microsoft.VisualBasic.Mid((Microsoft.VisualBasic.Right(txtESN.Text, 8)), 4, 1) + Microsoft.VisualBasic.Mid((Microsoft.VisualBasic.Right(txtESN.Text, 8)), 6, 1))), 6)
and this is the excel one
VB.NET:
=IF(LEN($B$3)=11,RIGHT((POWER(2,5+(LEFT((LEFT($B$3,3)),1)+RIGHT(LEFT($B$3,3))+MID(LEFT($B$3,3),2,1)))-1)*((RIGHT($B$3,3))+199)* ' (23+(LEFT((RIGHT($B$3,8)),1)+RIGHT((RIGHT($B$3,8)),1)+MID((RIGHT($B$3,8)),3,1)+MID((RIGHT($B$3,8)),5,1) ' +MID((RIGHT($B$3,8)),7,1)+MID((RIGHT($B$3,8)),2,1)+MID((RIGHT($B$3,8)),4,1)+MID((RIGHT($B$3,8)),6,1))),6), ' "Need 11 Digit")
Thanks in advanced guys.