|
|
|
МАКРОС НА ActiveChart.SeriesCollection(х)
|
|||
|---|---|---|---|
|
#18+
Пишу макрос на основе ActiveChart.SeriesCollection(х) - построение графиков на основе динамических данных , при ActiveChart.SeriesCollection(1) работает нормально , но при выполнения аналогичного макраса но для ActiveChart.SeriesCollection(2)- выдает ошибку (1004), основной код прилагаю: Sub GRAPH10(resultrange As Range) resultrange.Select CellNamber = resultrange.Count StartRow = resultrange.Cells.Row StartColumn = resultrange.Cells.Column Cells(StartRow, StartColumn).Select RowID = StartRow 'Проверяем со второй ячейки ColumID = StartColumn Cells(RowID, ColumID).Select While ActiveCell.Value <> "Общий фонд производственного времени" RowID = RowID + 1 Cells(RowID, ColumID).Select RowNumber = RowNumber + 1 Wend If RowNumber < 2 Then Exit Sub End If y1 = RowID x1 = 31 RowID2 = RowID ColumID2 = ColumID + 1 RowNumber2 = RowNumber Cells(RowID2, ColumID2).Select While ActiveCell.Value <> "Общий результат" RowID2 = RowID2 + 1 Cells(RowID2, ColumID2).Select RowNumber2 = RowNumber2 + 1 Wend If RowNumber < 2 Then Exit Sub End If y2 = RowID2 x2 = x1 'MsgBox RowID2 'MsgBox x2 Set sh = ThisWorkbook.Worksheets("РЕМОНТЫ") sh.Activate ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartArea.Select Dim WS As Worksheet Set WS = Worksheets("РЕМОНТЫ") ActiveChart.SeriesCollection(1).Values = WS.Range(WS.Cells(y2, x1 + 4), WS.Cells(y2, x1 + 18)) ActiveChart.SeriesCollection(1).XValues = WS.Range(WS.Cells(223, 35), WS.Cells(223, 49)) End Sub ПРИ замене 1 на 2 во втором макросе выдает ошибку (МАКРОС надо выполнять для каждого для ActiveChart.SeriesCollection(х) отдельно так как данные лежат в разных местах таблицы) Может дело в двойной активации charta? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.07.2008, 17:35 |
|
||
|
|

start [/forum/topic.php?fid=60&msg=35440148&tid=2162039]: |
0ms |
get settings: |
7ms |
get forum list: |
12ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
50ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
33ms |
get tp. blocked users: |
1ms |
| others: | 236ms |
| total: | 354ms |

| 0 / 0 |
