node-google-spreadsheet
node-google-spreadsheet copied to clipboard
Getting value of merged cells having one of the cells
Hey guys!
I have some cells merged in the range B2:B6. I got one of the cells using getCellByA1
:
const cell = sheet.getCellByA1('B3')
Is there any way I can get the value of the merged cell?
cell.value
returns null. Same happens with all the methods mentioned here.
Thanks! Awesome package.
So this is how the google api works - reading from a merged cell, other than the top-left one - will return empty.
The way to deal with this is to read from the sheet's "merges" info - see https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/sheets
This is not something I've dealt with yet. Would be open to PRs though!
Hi, is there a method to get "merges" with this wrapper ?
Haven't implemented it yet, but it should be pretty straightforward. Feel free to open a PR!