View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
NDBC NDBC is offline
external usenet poster
 
Posts: 204
Default Programming error - Procedure too large

Don you are exactly right. I already know how to reduce it to 1/5 it's size
but that's not to say there isn't even more efficiencies to be gained. I have
5 text boxes in a form and at the moment I evaluate each box exactly the same
way but I have sections of code for each box when I could just have a loop
stepping by one.

The boxes are called rider1 through to rider 5. I am having trouble with
this code at the moment

If Rider5.Value < 100 Or IsNumeric(Rider5) = False Then

I have now got

For Box = 5 to 1 step -1

If "Rider" & box.Value < 100 Or IsNumeric("Rider" & box) = False Then

This does not work. I just thought maybe it needs to be in brackets.

Any ideas.

"Don Guillett" wrote:


It's VERY possible your code can be greatly streamlined. Care to show it to
us?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"NDBC" wrote in message
...
I have a private subroutine that has just started giving me this error when
I
tried to run it. The only thig i changed was the format of the time
variables
and it is not really that large. The debugger just highlights the sub and
end
sub lines. What can cause this problem.