Skip to content

Instantly share code, notes, and snippets.

@chrishuan9
Created November 29, 2018 06:54
Show Gist options
  • Save chrishuan9/54771ff3dffe610ecd02e3d1f839abb4 to your computer and use it in GitHub Desktop.
Save chrishuan9/54771ff3dffe610ecd02e3d1f839abb4 to your computer and use it in GitHub Desktop.
Hex String Big to Little Endian in Excel
' 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