Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Change Sub problem
Hello,
I have a problem with Sub Worksheet Change below. Not sure if it is the code or some system setting. The problem is that it does not run when changes are made on the sheet it's attached to. I tried to trace the problem in VB and the sub does not get activated at all (not just because the condition in the sub is false) - I tried enable events but it's not it. Any thoughts of where the problem could be and how to solve it? Not sure if this matters but I have an XLA attached. The workbook does not contain any code except the SUB below and all my macros are loaded via Reference to external XLA module. The funny part is that it worked once or twice after I wrote it then for some reason, stopped. Confused Jack Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 41 And Target.Row <= 42 _ And Target.Column = 10 And Target.Column <= 14 _ Then ActiveSheet.ChartObjects("Chart 10").Activate ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = Sheets("Payoff").Range("J42").Value .MaximumScale = Sheets("Payoff").Range("K42").Value .MinorUnit = Sheets("Payoff").Range("L42").Value .MajorUnit = Sheets("Payoff").Range("M42").Value .Crosses = xlCustom .CrossesAt = Sheets("Payoff").Range("N42").Value .ReversePlotOrder = False .ScaleType = xlLinear End With ActiveChart.Axes(xlCategory).Select With ActiveChart.Axes(xlCategory) .MinimumScale = Sheets("Payoff").Range("J41").Value .MaximumScale = Sheets("Payoff").Range("K41").Value .MinorUnit = Sheets("Payoff").Range("L41").Value .MajorUnit = Sheets("Payoff").Range("M41").Value .Crosses = xlCustom .CrossesAt = Sheets("Payoff").Range("N41").Value .ReversePlotOrder = False .ScaleType = xlLinear End With Sheets("Payoff").Range("A1").Select End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Change Sub problem
Jack
works for me ... at least in terms of activating the routine. I can only test it so far as I don't have the data. Are you sure it's in the sheet code for the sheet that you are changing ? Regards Trevor "jwlabno" wrote in message u... Hello, I have a problem with Sub Worksheet Change below. Not sure if it is the code or some system setting. The problem is that it does not run when changes are made on the sheet it's attached to. I tried to trace the problem in VB and the sub does not get activated at all (not just because the condition in the sub is false) - I tried enable events but it's not it. Any thoughts of where the problem could be and how to solve it? Not sure if this matters but I have an XLA attached. The workbook does not contain any code except the SUB below and all my macros are loaded via Reference to external XLA module. The funny part is that it worked once or twice after I wrote it then for some reason, stopped. Confused Jack Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 41 And Target.Row <= 42 _ And Target.Column = 10 And Target.Column <= 14 _ Then ActiveSheet.ChartObjects("Chart 10").Activate ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = Sheets("Payoff").Range("J42").Value .MaximumScale = Sheets("Payoff").Range("K42").Value .MinorUnit = Sheets("Payoff").Range("L42").Value .MajorUnit = Sheets("Payoff").Range("M42").Value .Crosses = xlCustom .CrossesAt = Sheets("Payoff").Range("N42").Value .ReversePlotOrder = False .ScaleType = xlLinear End With ActiveChart.Axes(xlCategory).Select With ActiveChart.Axes(xlCategory) .MinimumScale = Sheets("Payoff").Range("J41").Value .MaximumScale = Sheets("Payoff").Range("K41").Value .MinorUnit = Sheets("Payoff").Range("L41").Value .MajorUnit = Sheets("Payoff").Range("M41").Value .Crosses = xlCustom .CrossesAt = Sheets("Payoff").Range("N41").Value .ReversePlotOrder = False .ScaleType = xlLinear End With Sheets("Payoff").Range("A1").Select End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to change the pivot chart automaticaly as values in the worksheet change | Excel Worksheet Functions | |||
Macro change problem | Excel Discussion (Misc queries) | |||
CHANGE MARCO PROBLEM | Excel Discussion (Misc queries) | |||
change formula in a shared worksheet without losing change history | Excel Worksheet Functions | |||
Worksheet Change by Value problem | Excel Discussion (Misc queries) |