PDA

View Full Version : [SOLVED:] Can I use an excel sheet to calculate in a vba program?



Mr_M_from_G
05-13-2016, 05:05 AM
Hello,

(I asked this question also in a german forum: vba-forum.de #27493 , sorry i am not allowed to post a link to the thread)

I have an excel sheet containing a lot of data and with this data it calculates some (about 10) input values into 4 output values. For this I named the input cells inp1...inp10 and the output cells out1..out4.
Now I have a list of input values and they are likely to change several times, so I want to calculate the list through automatically. Is this possible with a vba script? So I want a vba that takes from one row in an excel sheet 10 values and inserts them into inp1...inp10 of the first named excel sheet and wait until everything is calculated and then take the results from out1...out4 and copy them behind inp10 and then proceed with the next line of inp1...inp10 until all lines are through.
I would think that there is a timing problem, but I am not so experienced with vba.

Any help or comments are welcome

Thanks

Martin

SamT
05-13-2016, 05:15 AM
In your code, put Application.Caclulate on the line after putting the input values on the sheet. Put the code to copy the results after that line.

For more definitive help, post your existing code here. The # icon will insert CODE Tags to put your code between.

Mr_M_from_G
05-19-2016, 06:17 AM
Hi Sam,

thanks for the hint, I got along with it and succeeded with my program

Martin