View Single Post
 
Old 06-21-2014, 09:11 AM
champaben champaben is offline Windows 8 Office 2007
Novice
 
Join Date: Jun 2014
Posts: 6
champaben is on a distinguished road
Default

Quote:
Originally Posted by BobBridges View Post
I haven't checked whatsup's formula, but I agree with him that some formula would work and be faster than using GoalSeek. But for the sake of explaining VBA, I'll continue with your original problem, because that's worth knowing even if the formula is better this time.

I'll do this in steps. The first step is to create a module where you can put the "common code", the VBA statements that every worksheet will call. Here's how you do it in Excel 2010 (and if you're using some other version let me know):

1) Start in the VBA editor.

2) Right click anywhere inside the red box in the below screen shot.

3) Select "Insert", then "Module". An empty module will be created in the Modules section. (You see in the screen shot that I already have one created.)

4) Optional: I named mine "mGoalSeek"; you can leave yours named "Module1" or whatever VBA names it by default, or you can change it to your own name by typing over the Name in the Properties window. Let me know if you have trouble with this and I'll show you another screen shot.

The new module is ready for you to type in, creating any new subroutines or functions.

Next I'll describe how to write a subroutine that your individual worksheets can call....in a separate post.
Thanks for your input and time, I have figured the problem out.
Reply With Quote