PDA

View Full Version : Solved: Understanding Modules



rrtts
10-11-2006, 03:10 PM
Is there any advantage or disadvantage to having multiple modules or can I throw the VBA code for multiple subroutines into one module and record a macro as necessary from the code within the module.

(Hope that makes sense)

Also, I have two macros (using a button to activate each of them) that work perfectly but I'm having a hard time getting one button to operate both. Am I missing something?

Bob Phillips
10-11-2006, 03:58 PM
Have multiple modules. There are two major advantages, it allows you to organise your code more logically, and it avoids running up against the 64Kb module size limit.

Call one from within the other



Sub Macro1() 'assign this to the button
... some code
call Macro2
End Sub

Sub Macro2()
... some more code
End Sub

rrtts
10-11-2006, 04:32 PM
ah...placement is everything...finally tinkered around with it long enough and got it to work.

And thanks for the info on modules...appreciate the help!