Persisting the changes of range objects after selection in HTML

For each selection, you could serialize the selected range to character offsets and deserialize it again on reload using something like this: Demo: http://jsfiddle.net/WeWy7/3/ Code: var saveSelection, restoreSelection; if (window.getSelection && document.createRange) { saveSelection = function(containerEl) { var range = window.getSelection().getRangeAt(0); var preSelectionRange = range.cloneRange(); preSelectionRange.selectNodeContents(containerEl); preSelectionRange.setEnd(range.startContainer, range.startOffset); var start = preSelectionRange.toString().length; return { start: … Read more

Convert an entire range to uppercase without looping through all the cells

Is there a method I can use to convert the whole range in one line? Yes you can convert without looping. Try this Sub Sample() [A1:A20] = [INDEX(UPPER(A1:A20),)] End Sub Alternatively, using a variable range, try this: Sub Sample() Dim rng As Range Set rng = Range(“A1:A20”) rng = Evaluate(“index(upper(” & rng.Address & “),)”) End … Read more