Hi imrags,
I have not benchmarked, but by adding next we can avoid some extra executions. It is not going to boost more performance, but slight improvement will be there.
use strict; use warnings; for my $i (1 .. $LastRow) { if ($Sheet->Range("E$i")->{Value} =~ /MSD/){ next; } else{ $CB_COUNT++; if ( $Sheet->Range("J$i")->{Value} !~ /No_/i){ $NM_COUNT++; } }
OP has updated the code. Posted solution for the previous one. update: Removed extra 'if' statement in 'else' part.
Prasad
In reply to Re: Win32::OLE & Excel help
by prasadbabu
in thread Win32::OLE & Excel help
by imrags
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |