Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increment a Variable Value Display Results of Each Iteration - Macro help needed 1

Status
Not open for further replies.

RFreund

Structural
Aug 14, 2010
1,873
0
36
US
I've attached a spreadsheet that I need some help with. I am in the beginning stages of learning C++ and will eventually get to VBA but I'm not there yet. I think I could actually generate the 'for' loop and then out putting the results in C++ but I don't know VBA very well :(.

Essentially what I need is to increment a value (failure angle) and output the associated result (active force). Each of these to display in a column. I will take it from there i.e next find max results make graphs, etc.

The spreadsheet has comments of what I'm looking to accomplish. Let me know if you have any questions.

Thanks I appreciate your help!!

EIT
 
Replies continue below

Recommended for you

You could look at using a data table to do what you want. It looks like MS don't like to talk about data tables all that much any more, but they do have an article here: Look under "what-if analysis" on the data tab.

Alternatively if you'd like to have a go at VBA, it's pretty easy to do what you want. In fact I've set up a macro to do it (took about 15 minutes).

I really don't see any benefit in doing it in C++. Almost all the work is in transferring data from the spreadsheet and back, and you'll need to know the VBA object model to do that anyway.

To run the macro in the attached file press Alt-F8 and select Active_Force. To see the code press Alt-F11. To step through the code press F8 when in the VB Editor window.

I have changed the file extension to xlsb so it will store the macro. You can also use .xlsm if you want.

Any questions, please ask.

Doug Jenkins
Interactive Design Services
 
Doug,

Wow, thank you! For some reason I did not receive or missed the email alert. I actually have modified the spreadsheet since and even created another one where I need the same process. I will look this over and try to understand what's going on here as I seem to need this type of routine quite often.
When I was referring to C++ if simply meant the syntax of C++. Thank you for the help, it's greatly appreciated.

EIT
 
Status
Not open for further replies.
Back
Top