Created
November 29, 2018 06:54
-
-
Save chrishuan9/54771ff3dffe610ecd02e3d1f839abb4 to your computer and use it in GitHub Desktop.
Hex String Big to Little Endian in Excel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' VBA function which changes big to little endian | |
' reverses 1 byte (2 hex number pair) | |
' e.g changes 480000074B26E42D to 2DE4264B07000048 | |
' | |
Public Function strReverse_Character_Pairs(ByVal strValue As String) As String | |
Dim lngLoop As Long | |
Dim strReturn As String | |
strReturn = "" | |
For lngLoop = Len(strValue) - 1& To 1& Step -2& | |
strReturn = strReturn & Mid$(strValue, lngLoop, 2) | |
Next lngLoop | |
strReverse_Character_Pairs = strReturn | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment