Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Splitting a Procedure
Mark,
That's a lot of tedious typing that you did. Along with what Steve gave you regarding shortening the actual lines of code, you can split this up into separate (smaller) subs in this fashion: What you have now: Case1 ' lots of code Case2 'lots of code Case3 'lots of code ' etc. What you can do: Create a new sub named "Sub myCase0()" Into that sub, move all of the Case0 code. Create another sub named "Sub myCase1()" Into that sub, move all of the Case1 code. Do the same for the rest of the Cases Now, in your main sub just call those other subs: e.g. Private Sub Up1_Click() Select Case LB1.ListIndex Case 0 'First item in list myCase0 Case1 myCase1 'etc. John Mark wrote: When I run the code below I get a compile error message that states procedure to large. The knowledge base tells me to split the procedure. How do i do this? Here is the procedure below. Any suggestions or help is extremely appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sub procedure | Excel Discussion (Misc queries) | |||
Stop a Procedure from another procedure | Excel Discussion (Misc queries) | |||
Procedure is too big | Excel Worksheet Functions | |||
VBA Procedure | Excel Discussion (Misc queries) |