Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert a string to a number

Status
Not open for further replies.

Per9922

IS-IT--Management
Oct 1, 2004
74
SE
Hello,

I have a string of 8 bytes that I would like to convert to a number. I read the bytes from a file and I need to change the order of the bytes before converting the number to a string according to the following.

96 6A 45 43 39 01 00 00 -> 00 00 01 39 43 45 6A 96

How do I do I change the order and convert the string to a number in VBA ?

Thanks Per
 
Thanks again!

There are no avaiable function in VBA that do this :( ?
 
Oh, I think this can be done a little more easily., but I'm not near a machine itch Vba on it currently
 
strongm, you thinked about a CopyMemory API call ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
OK, found something.
As every so often, Google is your friend - if know exactly what to look for. :p

Lookey here (scroll to the last post):

Does that do what you want it to do? Can't try it myself at the moment.

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
>CopyMemory

In essence. But I would do it without resorting to the API directly, and use LSet as per the link provided by MakeItSo (and note if he'd searched on THIS site, he'd have found how to do this as well; here's one of my posts on the subject, dated about 6 years ago ... thread222-1183258
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top