I'm not sure this will work for you, but consider replacing or duplicating the formulas in your "12" cells with an Evaluate
call. It's a little tricky to avoid runtime errors, so I suggest reading this. It might look something like this.
'wsRepository.Range("E" & i).Value = wsInput.Range("U12").Value
wsRepository.Range("E" & i).Value = Evaluate("SUM(A1:A10)")
Of course, using the formula in U12
. Your mileage may vary, but this should let you set calculation to manual (I think). I would prefer the method Mat's Mug described though. This is just another option to try.
##Some other notes
Some other notes
i
is typically used as a loop counter, butrow
would be more meaningful.4
and2004
are mysterious hardcoded numbers. What a lot of programmers refer to as magic numbers. It would good for readability/maintainability to replace them withstartRow
andlastRow
constants.- Great comments in my opinion. They're short and clear. Not too much, not too little.
- I'm not sure why you activate
wsInput
at the end, but you do a great job of avoiding it elsewhere, make sure you're not needlessly activating the sheet there.
I'm not sure this will work for you, but consider replacing or duplicating the formulas in your "12" cells with an Evaluate
call. It's a little tricky to avoid runtime errors, so I suggest reading this. It might look something like this.
'wsRepository.Range("E" & i).Value = wsInput.Range("U12").Value
wsRepository.Range("E" & i).Value = Evaluate("SUM(A1:A10)")
Of course, using the formula in U12
. Your mileage may vary, but this should let you set calculation to manual (I think). I would prefer the method Mat's Mug described though. This is just another option to try.
##Some other notes
i
is typically used as a loop counter, butrow
would be more meaningful.4
and2004
are mysterious hardcoded numbers. What a lot of programmers refer to as magic numbers. It would good for readability/maintainability to replace them withstartRow
andlastRow
constants.- Great comments in my opinion. They're short and clear. Not too much, not too little.
- I'm not sure why you activate
wsInput
at the end, but you do a great job of avoiding it elsewhere, make sure you're not needlessly activating the sheet there.
I'm not sure this will work for you, but consider replacing or duplicating the formulas in your "12" cells with an Evaluate
call. It's a little tricky to avoid runtime errors, so I suggest reading this. It might look something like this.
'wsRepository.Range("E" & i).Value = wsInput.Range("U12").Value
wsRepository.Range("E" & i).Value = Evaluate("SUM(A1:A10)")
Of course, using the formula in U12
. Your mileage may vary, but this should let you set calculation to manual (I think). I would prefer the method Mat's Mug described though. This is just another option to try.
Some other notes
i
is typically used as a loop counter, butrow
would be more meaningful.4
and2004
are mysterious hardcoded numbers. What a lot of programmers refer to as magic numbers. It would good for readability/maintainability to replace them withstartRow
andlastRow
constants.- Great comments in my opinion. They're short and clear. Not too much, not too little.
- I'm not sure why you activate
wsInput
at the end, but you do a great job of avoiding it elsewhere, make sure you're not needlessly activating the sheet there.
I'm not sure this will work for you, but consider replacing or duplicating the formulas in your "12" cells with an Evaluate
call. It's a little tricky to avoid runtime errors, so I suggest reading this. It might look something like this.
'wsRepository.Range("E" & i).Value = wsInput.Range("U12").Value
wsRepository.Range("E" & i).Value = Evaluate("SUM(A1:A10)")
Of course, using the formula in U12
. Your mileage may vary, but this should let you set calculation to manual (I think). I would prefer the method Mat's Mug described though. This is just another option to try.
##Some other notes
i
is typically used as a loop counter, butrow
would be more meaningful.4
and2004
are mysterious hardcoded numbers. What a lot of programmers refer to as magic numbers. It would good for readability/maintainability to replace them withstartRow
andlastRow
constants.- Great comments in my opinion. They're short and clear. Not too much, not too little.
- I'm not sure why you activate
wsInput
at the end, but you do a great job of avoiding it elsewhere, make sure you're not needlessly activating the sheet there.