View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Why Error Message "End Select without Select Case"?

Hi Al

Not sure why it would be slow but you might have some success speeding
it up if you turn off calculation, execute then turn calculation back on eg:

Dim calcmode As Long

calcmode = Application.Calculation 'Get current calc setting
Application.Calculation = xlCalculationManual

'yourcode here

Application.Calculation = calcmode 'return to initial setting

Also are you sure you need to add the hyperlink to each sheet every time
the index sheet is selected. It seems you would just be doing this over
and over again.

Finally you can probably get rid of the M = 1, M= M + 2 stuff as you are
not using M anywhere from what I can see.

Hope this helps
Rowan

GoFigure wrote:
Many thanks, Rowan. Guess I was really tired to miss the "End With".

EXECUTION SPEED

This code must be a kludge because it takes to take an indordantly long
time to execute. I changed the three original IF statements I had to a
Case statement in the hopes of improving the speed of execution. No
soap.

When I use the Timer function for each Sub execution, I get the
following results (seconds):


- 8 worksheets ~ 0.9
- 10 worksheets ~ 1.3
- 13 worksheets ~ 2.0


Of course, this elapsed time is very noticeable.

Does anyone have any ideas for how I could make this code more
efficient?

Many thanks,

- Al