An interesting problem

McGlinchy, Alistair Alistair.McGlinchy at
Thu Jan 4 14:39:08 GMT 2007

> Thanks Alastair, it's now about 10 seconds to process rather than an 
> over an hour.
> >                         print "Range ($x_start,$y_start) ,
> > ($x_end,$y_end) is better with $val\n";
> >                         @result = ($x_start,$y_start,$x_end,$y_end);
> I did find that it's actually returning row,column row,column rather 
> than column row.

Ah, yes the sense for row/columns is revered, woops. Here's a patch for
you're Excel work.

my $c="A"; 
my @excel_col = map {$c++} (1..256);

sub excel_coord {
    my ($x1,$y1,$x2,$y2) =@_;
    return sprintf( "%s%s:%s%s",
        $excel_col[$y1], $x1+1,
        $excel_col[$y2], $x2+1

Registered Office:
Marks and Spencer plc
Waterside House
35 North Wharf Road
W2 1NW

Registered No. 214436 in England and Wales.

Telephone (020) 7935 4422
Facsimile (020) 7487 2670


Please note that electronic mail may be monitored.

This e-mail is confidential. If you received it by mistake, please let us know and then delete it from your system; you should not copy, disclose, or distribute its contents to anyone nor act in reliance on this e-mail, as this is prohibited and may be unlawful.

More information about the mailing list