[Solved] Copy only visible cells

Discuss the spreadsheet application
Post Reply
vasa1
Volunteer
Posts: 261
Joined: Sat Dec 26, 2009 1:20 pm
Location: Bombay

[Solved] Copy only visible cells

Post by vasa1 »

I came across this extension and I think it fills a lacuna in Calc:
http://extensions-test.libreoffice.org/ ... ible-cells
Last edited by vasa1 on Sun May 06, 2012 8:00 am, edited 1 time in total.
LibreOffice 5.2.1.2 on Lubuntu 16.04 (Openbox)
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Copy only visible cells

Post by Villeroy »

My simplified version without dispatches: http://www.oooforum.org/forum/viewtopic.phtml?t=38775
And something to fill down/up/left/right: http://sourceforge.net/projects/ooomacr ... on%201.01/
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
vasa1
Volunteer
Posts: 261
Joined: Sat Dec 26, 2009 1:20 pm
Location: Bombay

Re: [Solved] Copy only visible cells

Post by vasa1 »

After some excitement (http://nabble.documentfoundation.org/Us ... 64486.html), I gave Villeroy's code a try and "it just works".
LibreOffice 5.2.1.2 on Lubuntu 16.04 (Openbox)
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Copy only visible cells

Post by Villeroy »

vasa1 wrote:After some excitement (http://nabble.documentfoundation.org/Us ... 64486.html), I gave Villeroy's code a try and "it just works".
vasa1 wrote:I came across this extension and I think it fills a lacuna in Calc:
http://extensions-test.libreoffice.org/ ... ible-cells
Thank you for the positive feedback. The macro is really simple though not as perfect as it should be. It just works within the same document and yesterday read your comment on the libreoffice list, tested it again after many years and noticed that I've got to modify it.
Before version 3 a rectangle of cells in a filtered range was regognized as a single range. Now you actually select multiple ranges of visible cells when your rectangle includes filtered rows and Calc can copy&paste these disjunct but regular tiles of cells. This makes my macro obsolete for many use cases where only filtered rows are involved but if you want to copy hidden and filtered cells in one go the old version complains about the multiple range selection and stops with a message.
I removed the restriction to not accept a multiple range selection so it still works with rectangle of hidden and/or filtered cells. But now you may also copy irregular, disjunct ranges and multi-sheet selections with unclear results. You may lose data when you use this macro with irregular patterns of cells. Use it with one rectangle of cells at at time.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
vasa1
Volunteer
Posts: 261
Joined: Sat Dec 26, 2009 1:20 pm
Location: Bombay

Re: [Solved] Copy only visible cells

Post by vasa1 »

Villeroy, I updated my copy with your changed version. The way I want to use the macro is exactly as I described in the libreoffice post. So I guess things should be fine for me. Thanks once again!
LibreOffice 5.2.1.2 on Lubuntu 16.04 (Openbox)
Post Reply