[Libreoffice-bugs] [Bug 122684] New: Copying range using VBA doesn't work correctly
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Sun Jan 13 07:30:09 UTC 2019
https://bugs.documentfoundation.org/show_bug.cgi?id=122684
Bug ID: 122684
Summary: Copying range using VBA doesn't work correctly
Product: LibreOffice
Version: 6.1.4.1 rc
Hardware: All
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Calc
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: GunnarAI at hotmail.com
Description:
When copying cell formulas using VBA, the normal method is:
Worksheets("Sheet1").Range(D4:E6).Copy
Worksheets("Sheet2")Range("D4:E6").PasteSpecial Paste:=xlPasteFormats
What is copied is whatever range that is selected!
To make it work, you must select the range you want to copy:
Add this line first:
Worksheets("Sheet1").Range(D4:E6).Select
Steps to Reproduce:
1.
Worksheets("Sheet1").Range(D4:E6).Copy
Worksheets("Sheet2")Range("D4:E6").PasteSpecial Paste:=xlPasteFormats
2.
Worksheets("Sheet1").Range(D4:E6).Select
Worksheets("Sheet1").Range(D4:E6).Copy
Worksheets("Sheet2")Range("D4:E6").PasteSpecial Paste:=xlPasteFormats
Actual Results:
1. Formatting copied from range that is selected, not the range specified!
2. This solves the problem but isn't the correct way to do format copy
Expected Results:
See Actual Results
Reproducible: Always
User Profile Reset: No
Additional Info:
[Information automatically included from LibreOffice]
Version: 6.1.4.1 (x64)
Build ID: 25073d18caee244880112e52c4a7e71f6081b3a9
CPU threads: 4; OS: Windows 10.0; UI render: GL;
Locale: nb-NO (nb_NO); Calc: CL
--
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/6b5e1f64/attachment.html>
More information about the Libreoffice-bugs
mailing list