--- SpreadSheetPlugin.pm.orig 2005-03-23 23:51:19.889344183 -0600 +++ SpreadSheetPlugin.pm 2005-03-24 00:13:14.944385341 -0600 @@ -427,8 +427,17 @@ $result = "R$i:C0..R$i:C$cPos"; } elsif( $theFunc eq "ABOVE" ) { + my $offset = $theAttr || 0; + my $first = 0; $i = $cPos + 1; - $result = "R0:C$i..R$rPos:C$i"; + if ($offset < 0) { + $first = -($offset) + 1; + $first = $rPos if ($first > $rPos); + } elsif ($offset > 0) { + $first = $rPos - $offset + 1; + $first = 1 if ($first < 1); + } + $result = "R$first:C$i..R$rPos:C$i"; } elsif( $theFunc eq "RIGHT" ) { $i = $rPos + 1;