Hi guys,
can anyone help me please?!
I have code that was working in Excel 2007, but I have upgraded my version of Office to 2010 and for some reason, the code keeps throwing back the error "Code Execution has been interrupted".
It seems to always stop on the NumberFormats of the following code:
The code is basically setting a NumberFormat based on what option is chosen.
Has anyone got any ideas as to why this is happening? As I said, it worked fine in Excel 2007, but won't work now....so so so so so so frustrating!
Thanks,
Eoin
can anyone help me please?!
I have code that was working in Excel 2007, but I have upgraded my version of Office to 2010 and for some reason, the code keeps throwing back the error "Code Execution has been interrupted".
It seems to always stop on the NumberFormats of the following code:
Code:
Set TrendA = Sheets("Trend Analysis")
If (TrendA.Range("U33") = "A" Or TrendA.Range("U33") = "B") Then
TrendA.Range(TrendA.Cells(39, 5), TrendA.Cells(44, 17)).NumberFormat = "#,##0.0%"
TrendA.ChartObjects("CompChart2").Chart.Axes(xlValue).TickLabels.NumberFormat = "#,##0.0%"
ElseIf (TrendA.Range("U33") = "C" Or TrendA.Range("U33") = "D" Or TrendA.Range("U33") = "E" Or TrendA.Range("U33") = "F" Or TrendA.Range("U33") = "G") Then
TrendA.Range(TrendA.Cells(39, 5), TrendA.Cells(44, 17)).NumberFormat = "#,##0.00_ ;[Red](#,##0.00)"
TrendA.ChartObjects("CompChart2").Chart.Axes(xlValue).TickLabels.NumberFormat = "#,##0.00_ ;[Red](#,##0.00)"
Else
TrendA.Range(TrendA.Cells(39, 5), TrendA.Cells(44, 17)).NumberFormat = "#,##0_ ;[Red](#,##0)"
TrendA.ChartObjects("CompChart2").Chart.Axes(xlValue).TickLabels.NumberFormat = "#,##0_ ;[Red](#,##0)"
End If
The code is basically setting a NumberFormat based on what option is chosen.
Has anyone got any ideas as to why this is happening? As I said, it worked fine in Excel 2007, but won't work now....so so so so so so frustrating!
Thanks,
Eoin