Hey David,
I currently shuffle selected text using this macro. Hopefully does what you need or can be adapted fairly easily.
if (document.CellMode == true ) {
document.CellMode = false;
}
if( document.selection.IsEmpty ){
// nothing is selected
alert( “Select the text you want to shuffle\r\nIf this is a delimited file, select all text” );
}
else {
strSelText = document.selection.Text;
strLinebreak = “\r\n”;
arrLinesArray = strSelText.split(strLinebreak);
arrLinesArray.sort(function random(){return 0.5 – Math.random()});
arrOut = arrLinesArray.join(strLinebreak);
document.selection.Text = arrOut;
}