M
MichaelC
I'd truly appreciate any help in debugging the RunTimeError1004 that crops up
on most of the coding lines in the macro below.
Thanks in advance for your kind help.
Sub ChartInteger()
'This Chart is drawn to show the outcome of inputting 400+ different values
into an active cell in Sheet("Control")
'The active cell can be any one of a 10x12 range where the column headings
are called TradeAttribute
'A separate macro iterates the 400 input values into each cell and writes
them, and the result of applying
'a complex formula, onto another Sheet("Detail")
'The Sheet("Detail") contains 2x400 row columns of outcomes from varying the
values of each Active Cell 400 times
'I want to use the Active Cell is the identifier for each of the 400 row
columns of Chart data in Sheet("Detail")
'RunTime error 1004 appears at virtually every line
RowValue = ActiveCell.Row
ColumnValue = ActiveCell.Column
TradeAttribute = Sheets("Control").Cells(11, ColumnValue)
ActiveSheet.ChartObjects("ChartInteger").Select
Set BeginInput = Sheets("Detail").Range("VarInput").Offset((RowValue - 12) *
500, TradeAttribute)
Set EndInput = Sheets("Detail").Range("VarInput").Offset(495 + ((RowValue -
12) * 500), TradeAttribute)
Set BeginPL = Sheets("Detail").Range("VarInput").Offset(((RowValue - 12) *
500), TradeAttribute + 12)
Set EndPL = Sheets("Detail").Range("VarInput").Offset((495 + (RowValue - 12)
* 500), TradeAttribute + 12)
Set InPutData = Sheets("Detail").Range(Cells(BeginInput, 0), Cells(EndInput,
0))
Set PLData = Sheets("Detail").Range(Cells(BeginPL, 0), Cells(EndPL, 0))
ActiveChart.SeriesCollection(1).Values = "=Detail!InputData"
ActiveChart.SeriesCollection(1).XValues = "=Detail!PLData"
ActiveChart.SeriesCollection(1).Name = "=Detail!C1"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Control"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "TBDRange"
End With
Sheets("Control").Select
End Sub
on most of the coding lines in the macro below.
Thanks in advance for your kind help.
Sub ChartInteger()
'This Chart is drawn to show the outcome of inputting 400+ different values
into an active cell in Sheet("Control")
'The active cell can be any one of a 10x12 range where the column headings
are called TradeAttribute
'A separate macro iterates the 400 input values into each cell and writes
them, and the result of applying
'a complex formula, onto another Sheet("Detail")
'The Sheet("Detail") contains 2x400 row columns of outcomes from varying the
values of each Active Cell 400 times
'I want to use the Active Cell is the identifier for each of the 400 row
columns of Chart data in Sheet("Detail")
'RunTime error 1004 appears at virtually every line
RowValue = ActiveCell.Row
ColumnValue = ActiveCell.Column
TradeAttribute = Sheets("Control").Cells(11, ColumnValue)
ActiveSheet.ChartObjects("ChartInteger").Select
Set BeginInput = Sheets("Detail").Range("VarInput").Offset((RowValue - 12) *
500, TradeAttribute)
Set EndInput = Sheets("Detail").Range("VarInput").Offset(495 + ((RowValue -
12) * 500), TradeAttribute)
Set BeginPL = Sheets("Detail").Range("VarInput").Offset(((RowValue - 12) *
500), TradeAttribute + 12)
Set EndPL = Sheets("Detail").Range("VarInput").Offset((495 + (RowValue - 12)
* 500), TradeAttribute + 12)
Set InPutData = Sheets("Detail").Range(Cells(BeginInput, 0), Cells(EndInput,
0))
Set PLData = Sheets("Detail").Range(Cells(BeginPL, 0), Cells(EndPL, 0))
ActiveChart.SeriesCollection(1).Values = "=Detail!InputData"
ActiveChart.SeriesCollection(1).XValues = "=Detail!PLData"
ActiveChart.SeriesCollection(1).Name = "=Detail!C1"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Control"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "TBDRange"
End With
Sheets("Control").Select
End Sub