Slow coding in VBA Excel 2003
I am running a routine in Excel 2003 which takes minutes
to execute. The same routine in Excel-97 is exceuted
instandly showing no measurable delay.
The routine:
Set q1 = Workbooks(wbi).Sheets(wsi).Range(s1)
Set q3 = Workbooks(wbi).Sheets(wsi).Range(q1, q1.End
xlDown))
q3.Offset(0, 10).Select
For Each cell In Selection
cell.Value = cell.Value * 1
Next cell
The input file is a flat text file with 1000 records (rows)
I want to be sure that the data in collumn 10 is numeric
when copied. Previously in the coding I replaced some
decimal points for decimal comma's. This is the reason to
multply by 1.
It is the for/next loop (1000 cells) which takes 2
minutes on a 2,6 Ghz system.
regards,
Erik
|