Thread: slow macto
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Fan924 Fan924 is offline
external usenet poster
 
Posts: 238
Default slow macto

When this macro listed only 10 sheets, it worked fine & ended with a
single beep. Now that I made it work on 25 sheets, it hangs up for 3
seconds and ends with 7 beeps. I added Application.EnableEvents at the
front and end and it did not help. All sheets have these button names.
Where did I go wrong? excel 97

Sub SetSwitch1()
Dim ws3 As Worksheet
Set ws3 = Worksheets("Sheet1")
ws3.Range("A2").Value = "Switch1"
With Worksheets("Sheet2")
.OptionButton1.Value = True
.OptionButton2.Value = False
.OptionButton3.Value = False
End With
With Worksheets("Sheet3")
.OptionButton1.Value = True
.OptionButton2.Value = False
.OptionButton3.Value = False
End With
With Worksheets("Sheet4")
.OptionButton1.Value = True
.OptionButton2.Value = False
.OptionButton3.Value = False

<snip

With Worksheets("Sheet25")
.OptionButton1.Value = True
.OptionButton2.Value = False
.OptionButton3.Value = False
End With
With Worksheets("Sheet26")
.OptionButton1.Value = True
.OptionButton2.Value = False
.OptionButton3.Value = False
End With
Beep
End Sub