'do I have to insert a delay after modifying an equation variable in excel cells before copying the results to another worksheet?
I have an array of excel cells in a worksheet that will calculate the effective power produced by solar radiation hitting a solar panel of 1 meter by 1 meter. The array has 900 rows representing 900 minutes over a 15 hour period. The columns represent various tracking schemes. The formulae have the day of the year as an input (as well as sun angles, latitude, solar panel tilt, etc.). I sum the energy produced over every minute segment to get the total energy produced per tracking technique for each column that has a tracking style (for example) :
Sum(C2:C901)
My VBA program has a for next loop from day 1 to day 365 to cycle through all of the days of the year. After I set the day of the year in the for-next loop, I copy the total energy produced for each tracking style to a different worksheet.
Right now, I have an artificial time delay
For j = 1 To 10000
k = Sin(j)
Next j
inserted so that the cells can update before I copy them as I'm concerned that the day of year will change before the copy operation is complete.
Is there a more elegant way to ensure the cells have updated so that I can copy the updated cells before I change the day of year?
I think the best way to do this is to avoid the problem in the first place by doing all of the math in VBA and do not do it as formulae inside the cells in the worksheet, but seeing how I've already put the equations inside the cells, what would people suggest to make sure my cells update so that I can copy them before moving on to the next day of year?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
