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.

Apply fill to range of cells

See original GitHub issue

we can apply fill to a particular cell. But is there a way to apply fill to a range of cells like below?

    worksheet.getCell('A1:C3').fill = {
                type: 'pattern',
                pattern:'solid',
                fgColor:{argb:'FFFF0000'}
            };

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
dnshrcommented, Aug 26, 2017

that 2nd example throws forEach is not a function error.

2reactions
chenopcommented, Nov 13, 2017

Confirm that forEach throw exception.

Here is how I’ve implment it:

['A1', 'B1', 'C1', 'D1', 'E1', 'F1', 'G1'].map(key => {
        sheet.getCell(key).fill = {
            type: 'pattern',
            pattern:'solid',
            fgColor:{argb:'cccccc'}
        };
    });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Add or change the background color of cells - Microsoft Support
Apply a pattern or fill effects · Select the cell or range of cells you want to format. · Click Home > Format...
Read more >
How to Apply Fill Colors, Patterns, and Gradients to Cells in ...
Press Ctrl+1 to open the Format Cells dialog box and then click the Fill tab. · Click the Fill Effects button. · Select...
Read more >
Fill A Range - YouTube
Flash Fill in Excel · Excel 2016 - Fill Handle - How to Copy a Formula Down Column Cells - Use Paste Cell...
Read more >
Excel Formatting Tips for Worksheet Cells - Contextures
To fill each cell: · Right-click on a cell, and click Format Cells · On the Fill tab, click Fill Effects · Under...
Read more >
Apply Background Color to a Cell or the Entire Sheet in Excel
The background color once applied to the cells or the sheet using the “Fill Color” option will not change with the change in...
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