For some various purposes, I create arrays of data in oo basic, like an order of numbers from 0 to 5, using the "for" loop, or some other way and I paste them in the spreadsheet with help of macros.
But, whenever I want to undo this action, I have to undo it, step by step for every single element of array, because, the way I paste this data in spreadsheet is actually one step each time.
Since the openoffice can undo only upto 50 steps, when my array is longer than 50 elements, this action becomes irreversible
I looked for formulas to create imaginary array of data in background and pasting them in one step on the forum, but I am not sure about which method I must look for.
Here is my sample code that I use for creating and pasting an array. Could someone advise me what to do about this?
Edit: I must add one more question here. Let's say I have a text copied in the clipboard from internet which is consisted of 60 sentences and I have chosen 51 of them randomly by help of macros. The case is the same with this one as well, when I wish to paste the text on the spreadsheet, oo basic does this as one step each time. So this means this action becomes technically irreversible.
Code: Select all
sub pastesomedata
dim ocell
dim xx as integer
for xx = 0 to 17
ocell=thiscomponent.currentcontroller.activesheet.getcellbyposition(0, xx)
ocell.value = xx
next
end sub