question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Merged cells are not copied when copying worksheets

See original GitHub issue

Suppose I have worksheet1 which contains some merged cells. If I do

let worksheet2 = workbook.addWorksheet('Sheet2');
worksheet2.model = worksheet1.model;

worksheet2 will not have the same merged cells as worksheet1.

The problem seems to be the use of a wrong variable in _parseMergeCells of worksheet.js, specifically on line 523, where model.mergeCells is used instead of model.merges.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

5reactions
jonteycommented, Jun 28, 2018

While waiting for the fix

worksheet2.model = Object.assign(worksheet1.model, {
  mergeCells: worksheet1.model.merges,
});
1reaction
aksharjcommented, Dec 17, 2020

Hi @jontey, i am facing a similar issue, i am on the latest version, i am getting same error as mentioned by @jarkym. can you please let me know in what version your fix worked? may be i can try on that version, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Fixed!] Cannot Copy Merged Cells in Excel (4 Solutions)
1. Double Click and Copy Text then Paste to a Single Cell · Double click the merged cells C7:D7. · Then select the...
Read more >
How to Fix Cannot Copy Merged Cells in Excel - Sheetaki
First, let's take a look at the simplest method for copying data from merged cells. · Click the shortcut Ctrl + A to...
Read more >
We can't do that to a merged cell. - Microsoft Tech Community
To fix this problem, copy and paste a range of cells that matches the size of the merged cell. ⦁ Cut or delete...
Read more >
Excel: Can't copy data from merged cell - Business Tech Planet
Unfortunately, there is no other way of copying a merged formatted cell across — the only way you can actually do it is...
Read more >
How to copy and paste merged cells to single cells in Excel?
With the Paste option in Excel, you can quickly copy and paste the merged data into single cells, please do as follows: 1....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found