my %opts = (bg_color => "ffff00", align => "center", pattern => $pattern, ); # Add and define a format my $format_2 = $workbook->add_format(%opts);