in reply to Problem filling Excel cells with Solid Colour
$cell_interior_pattern{1} = xlPatternAutomatic; $cell_interior_pattern{2} = xlPatternChecker; $cell_interior_pattern{3} = xlPatternCrissCross; $cell_interior_pattern{4} = xlPatternDown; #... for $jq (sort {$a <=> $b} keys %cell_interior_pattern) {
Did you know that Perl has arrays? You don't need to sort the index list for them and you can construct them with a list like:
my @cell_interior_pattern = (xlPatternAutomatic, xlPatternChecker, xlP +atternCrissCross, xlPatternDown);
Just remember that the index starts from 0 and you'll be fine. Less verbose code and lower memory requirements and the right tool for the job. HTH.
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem filling Excel cells with Solid Colour: Arrays
by merrymonk (Hermit) on Mar 03, 2021 at 11:04 UTC | |
by GrandFather (Saint) on Mar 03, 2021 at 20:16 UTC | |
by merrymonk (Hermit) on Mar 03, 2021 at 16:31 UTC |