or download this
#Find Last Column and Row
my $LastRow = $Sheet->UsedRange->Find({What=>"*", SearchDirection=>xlP
+revious, SearchOrder=>xlByRows})->{Row};
my $LastCol = $Sheet->UsedRange->Find({What=>"*", SearchDirection=>xlP
+revious, SearchOrder=>xlByColumns})->{Column};