Bin to Dec w Var

A Snippet from: hagchr

Let>BinVal=10111010001000010
VBEval>Execute("Bin=""%BinVal%"":Res=0:For I = len(Bin) to 1 step -1:Dig=mid(Bin,I,1):select case Dig:case ""0"":case ""1"":Res=Res+(2^(len(Bin)-I)):end select:Next:"),
VBEval>Res,Res

Select the code above to paste into your macro. Or: View Raw Text

Link: http://www.mjtnet.com/snip.htm?g=537c5bf9c70d1

Forum Embed Code - click to select all then copy (CTRL-C):

When pasting into the forum do NOT modify the script code or it will not match what is in the database - create a new snippet instead!