I believe the other contributors have misunderstood your requirements & are simply offering advice to reverse the value provided.
With the input of 480000074B26E42D
, I think your required outcome is incorrect: 2DE4264B07000084
. The last two characters have been transposed, & the actual output will be:
2DE4264B07000048
.
If that is correct, you may use this Visual Basic for Applications function (stored in a Public code module)
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
Usage, based on the original text in cell A1
, would be as follows (with this formula placed in any cell other than cell A1
):
=strReverse_Character_Pairs(A1)
The function could also be enhanced to check that the value has an even number of characters by adding a "dummy" character at either end so that the reversed pairs are as intended.