View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
sali sali is offline
external usenet poster
 
Posts: 53
Default slow code with many loopings

huh, long code, just few ideas

to format number with leading zeroes, use numberformat="0000000#"

'worksheets' function searchs allways again, with each cell for worksheet,
instead use:

dim c1 as range
c1=worksheets("raw material forecast").cells(i,4)
if c1= ...

"Valeria" je napisao u poruci interesnoj
...
I have a long code (below) with many loopings to match cell values and
long
data lists, which is causing my code to be extremely slow (1 h)
Worksheets("BOMS").Cells(i, 1).NumberFormat = "@"
If Len(Worksheets("BOMS").Cells(i, 1)) < 8 Then
If Len(Worksheets("BOMS").Cells(i, 1)) = 7 Then
Worksheets("BOMS").Cells(i, 1) = "0" &
Worksheets("BOMS").Cells(i, 1)



For i = 1 To LastRowRWM
If IsNumeric(Worksheets("Raw Materials Forecast").Cells(i, 4)) = True Then