Hi Everyone,
I have this code below, but it is running extremely slow, by my calculations it would take 3 days to complete one sheet. Do you perhaps have suggestions on how to speed it up, as I have more than 100 sheets to get through please.
I have this code below, but it is running extremely slow, by my calculations it would take 3 days to complete one sheet. Do you perhaps have suggestions on how to speed it up, as I have more than 100 sheets to get through please.
Code:
Sub Calculate_Sheet()
Dim orderSh As Worksheet
Dim wiroSh As Worksheet
Dim lastRow As Long, r As Long
Dim pctComp As Double
With ThisWorkbook
'calculator
Set orderSh = .Sheets("ORDER")
'price list
Set wiroSh = .Sheets("WiroA3C100gsmI100gsm20-22pp ")
End With
lastRow = wiroSh.Cells(Rows.Count, 3).End(xlUp).Row
For r = 2 To lastRow
pctComp = (r / 800000) * 100
Application.StatusBar = "Progress..." & " " & pctComp & " " & "% Complete"
'copy from price list to calculator
orderSh.Range("f4") = wiroSh.Range("c" & r)
orderSh.Range("f5") = wiroSh.Range("d" & r)
orderSh.Range("f6") = wiroSh.Range("e" & r)
orderSh.Range("f7") = wiroSh.Range("f" & r)
orderSh.Range("f8") = wiroSh.Range("g" & r)
orderSh.Range("f9") = wiroSh.Range("h" & r)
orderSh.Range("f10") = wiroSh.Range("i" & r)
orderSh.Range("f11") = wiroSh.Range("j" & r)
orderSh.Range("f12") = wiroSh.Range("k" & r)
orderSh.Range("f13") = wiroSh.Range("l" & r)
'copy result
wiroSh.Range("m" & r).Value = orderSh.Range("F14")
Next r
End Sub