PDA

View Full Version : VBA Recalculation?



leftkick
02-20-2010, 07:23 PM
Hey all.
My first post here! :)

I have a spreadsheet with about 10 tabs. I'm trying to create something similar to a calculator of sorts. I think this might be a macro/vba task, but what I am trying to do is this:

I have my inputs and it will, according to the numeric assignments, give me an output of ranges. The time frame for this spreadsheet is something like over the next 75 years. I want it to automatically recalculate itself every 5 years so the numbers are more closely fit/statistically accurate.

Should I attempt to write some sort of macro/vba to recalculate itself every 5 years like: calculate for years 1 - 5, recalculate years 6 - 11, recalculate years 12 - 17, etc...

Any suggestions or help would be greatly appreciated. Thanks so much and I hope I made some sense!!

mbarron
02-20-2010, 07:58 PM
Can you provide a sample workbook? It would be much easier to help if we could see what you have and what you want to end up with.

leftkick
02-20-2010, 08:11 PM
Here is a very, very simple (read: stupid) example. I guess what I'm trying to say is that when I enter in the data, it gives me an output. But I want it to automatically give me an output for ages 1-5, then recalculate and give me an output for ages 6-10, etc....until the end of my sample size.

If this doesn't make sense, I apologize. I'm very tentative about putting a really lengthy sample of what I'm working on right now because it's part of my graduate work. Thanks

mbarron
02-20-2010, 08:22 PM
Your sample provides no insight into the problem. What data? What calculation?

Use dummy data, just show a true representation of what you have and what you want.

GTO
02-20-2010, 09:12 PM
If you save the example in .xls format, those with pre 2007 may also be able to help.

leftkick
02-21-2010, 05:28 PM
What about this:

If my formula looks like:
=IF(C5="Male",(19+(4.2*C8)+(5.7*C7)-(5.7*C6))*C11, (234+(4.233*C8)+(123.157*C7)-(8.87564*C6))*C11)

And I want to create hypotheticals for C6 (if age input is 25, I want it to recalculate when age is 30, recalculate when age is 40, and stop at age 50), is there any way that would work? I'm sorry I'm so slow and hesitant to post a dummy worksheet

Bob Phillips
02-21-2010, 05:33 PM
If you save the example in .xls format, those with pre 2007 may also be able to help.

Haven't you downloaded the Compatibility Pack (http://www.microsoft.com/downloads/details.aspx?FamilyId=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en) so that you can read 2007 files?

GTO
02-22-2010, 06:00 PM
Haven't you downloaded the Compatibility Pack (http://www.microsoft.com/downloads/details.aspx?FamilyId=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en) so that you can read 2007 files?

Sorry for the slow response and thank you for the link. No room to install in my poor ol' laptop I am afraid. My jokes about it wheezing or some guy w/a scythe galloping by at startup are not much exaggerated.