my $used_rows = $Sheet2->UsedRange->Rows(); for my $k (2..$used_rows) { }