![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 12
|
I have a piece of code that I just want to run when the sheet recalculates. However the code loops and I want it to stop as soon as it has finished the update. Any ideas... code below!!
Private Sub Worksheet_Calculate() Sheets("Leaderboard").Activate Range("A4:C61").Select Selection.sort Key1:=Range("C5"), Order1:=xlDescending, Key2:=Range("B5") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom End Sub |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi,
Try using "Application.EnableEvents"
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 12
|
Thanks
I thought it should be quite simple. Regards Dobbo |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|