Hi,
As to your code:
-- I'd define myArray as a Variant.
-- Use Split(Selection.Text, vbTab) instead of Split(Selection.Text, "^9")
-- You can't build the replacement text out of the matched text before
you've actually matched it.
Instead of fixing the code, it would be easier to set up a wildcard
replacement:
> {tab}Text{tab}1
> {tab}Text{tab}2
The lines end in paragraph marks ¶?
Find what: (^t)([!^13^t]@)(^t)([0-9]@)(^13)
Replace with: \1\4\3\2\5
Check "Match wildcards", and click "Replace all".
The macro recorder should give you something to work with...
Regards,
Klaus
> Hi,
>
[quoted text clipped - 52 lines]
> '
> End Sub