by iceman » Sat Apr 03, 2010 9:58 am
Hi,
I have done the following code, to clear the spreadSheet and reload the trigger conditions, after having forced in column Q, R, S the GreenUp type, Odds and Stake suggested by Gary's code GreenUp.xls.
When the markets are automathicly load in excel, the code works fine, but if I have more then one Sheet open VBA give's a run time error, and the macros stop to work.
Any suggestions?
Thanks anyway.
Private Sub Worksheet_Calculate()
Static MyMarket As Variant
Application.Calculation = xlCalculationManual
If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value
Range("A5:P49").Select
Selection.ClearContents
Range("T5:Z49").Select
Selection.ClearContents
Range("Q50:S50").Select
Selection.Copy
Range("Q5:S49").Select
Range("Q49").Activate
ActiveSheet.Paste
End If
Xit:
Application.Calculation = xlCalculationAutomatic
End Sub