[Libreoffice-bugs] [Bug 122684] Copying range using VBA doesn't work correctly

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sun Jan 13 23:20:04 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=122684

--- Comment #5 from Gunnar <GunnarAI at hotmail.com> ---
Thanks!
But the code fails to remove the contents of the copied range.

        rSrc = "B2:C5"
        rDst = "E2"
        Worksheets("Sheet1").Range(rSrc).Copy
destination:=Worksheets("Sheet2").Range(rDSt)
        Worksheets("Sheet2").Range(rDst).ClearContents

rDst points to upper left corner in the destination sheet, which is cleared.
rScr and rDst are not equal!
To make it work, you need to set rDst = "E2:F5" (same size)
But anyway, it's close to a solution.

This bug cost me a lot of trouble because what was copied was changing all the
time since the selected range was random, and I couldn't get hold of what was
going on. I was close to giving up until, by luck, the selected cell had a
different background color. Viola!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190113/0d481ef7/attachment.html>


More information about the Libreoffice-bugs mailing list