Reputation: 11
I am just a newbie with exceljs library. I am struggling to add format and formula on different sheets simultaneously. I will elaborate a little more:
I am using Excel to generate sort of an entry Excel file where the user will be able to write to that Excel workbook in different sheets. Thus, for populating some formulas. The issue is in terms of entering dates. In Excel, when you enter a date like 2012-12-12, it automatically changes to something like 12/12/12 in that cell, which is fine for now, according to my user case. But when I apply the following formula:
const formula = `IF(ISBLANK('sheet 2'!$${letter}$${row}), "", 'sheet 2'!$${letter}$${row});`
for (let row = 2; row <= 1000; row++) {
const formula = `IF(ISBLANK('sheet 2'!$${letter}$${row}), "", 'sheet 2'!$${letter}$${row})`;
const cell = sheet3.getCell(row, col + 1);
cell.value = {
formula: formula
};
}
This 12/12/12 will be something like 41255.
Is there a way I can keep this formula but at the same time copy exactly what is type/entered in the sheet1 to sheet 3.
Thanks,
Upvotes: 0
Views: 281