PDA

View Full Version : VBA Code to export formula to cells?



cyclonebell
03-29-2010, 11:28 AM
For the life of me I can't remember my basic VBA. I haven't programmed in years and don't have access to my documents to do this simple code. If anyone could point me in the right direction I would appreciate it.

I need to take a formula with one variable and input 8 different values (listed in excel) into that formula. A command button on the excel page exports the results of the 8 variables into excel cells.

It seems so simple I wish I could go back 5 years, I hope it is like riding a bike!

cyclonebell
03-29-2010, 01:10 PM
Any pointers in the right direction would be a huge help.

xld
03-29-2010, 01:27 PM
I think you need a lot more detail, I can think of a dozen ways to interpret what you penned earlier.

cyclonebell
03-29-2010, 02:03 PM
Sure, I can do that. I have 8 x-values. (-20, -10, 0, 5, 10, 15, 20, 25) I need a way to click a command button that inputs the 8 x-values into a formula say 2x+4 for example, and then export each of the 8 outputs to 8 different cells in excel.

Nothing fancy, thanks for the help so far XLD! :)