in reply to Spreadsheet::ParseExcel column access

If I undertand you correctly, what you want is a way to lookup the columnumber from the colomn heading? In that case this might be what you want: (untested)

my %colnum_for_name; $Worksheet = $excel->Worksheet("..."); foreach my $col ($Worksheet->{MinCol} .. $Worksheet->{MaxCol}) { my $cell = $Worksheet->{Cells}[0][$col]; if ($cell) { $colnum_for_name{ $cell->{Val} } = $col; } } # later my $someval = $Worksheet->{Cells}[$x][$colnum_for_name{'price'}];
hth

Replies are listed 'Best First'.
Re^2: Spreadsheet::ParseExcel column access
by hakana (Acolyte) on Feb 04, 2008 at 10:36 UTC
    Thanks that worked fine