Hi, first post here. I have a pretty big subroutine that I'm looking to break into pieces because it got too large to compile. In any VBA programming I've ever done in Excel, I've always just contained everything in one sub and never have broken things into several subs so I just want to make sure I'm doing it optimally. Basically, I'm creating a financial planning program that is doing a large amount of mathematical calculations in the code and interfacing with the spreadsheet as little as possible in order to minimize the time it takes to run. This means I'm using a couple hundred variables, some of which are used all the way thru the main sub from start to finish.
Here's a simple example of what I'd like to do:
Using the above as an example, if I need to program to calculate the volume of a cube I'd send the program into that subroutine passing it the variables of length, height, and width. It would calculate the volume and pass it back to the main subroutine. Does this look ok? Are there a limit to how many variables you can pass back and forth within the parentheses? Thanks.
Bookmarks