VB Code:
Public Function strScramble(keyString As String) As String
Dim newS As String
Dim stp1, lnCnt As Integer
Dim stp2 As Long
If Len(keyString) <= 2 Then strScramble = keyString: Exit Function
If Len(keyString) <= 5 Then strScramble = StrReverse(keyString): Exit Function
If InStr(keyString, vbCrLf) > 0 Then 'For multi-line text
'Get line count
lnCnt = (Len(keyString) - Len(Replace(keyString, vbCrLf, ""))) / 2
For stp2 = 0 To lnCnt
'Get line
gtLn = Split(keyString, vbCrLf)(stp2)
'Scramble Line
For stp1 = 1 To Len(gtLn) Step 4 'Reverse every group of 4
newS = (newS) & StrReverse(Mid$(gtLn, stp1, 4))
Next
'Add return line
newS = (newS) & vbCrLf
Next stp2
Else 'For single-line text
For stp1 = 1 To Len(keyString) Step 4
newS = (newS) & StrReverse(Mid$(keyString, stp1, 4))
Next
End If
strScramble = newS
End Function