Hello,
This may be one of those totally simple things, but I'm teaching myself vba and have been pounding on this problem for days.
In short, sheet2 has a series of graphs that pull data from sheet1 and this all works fine if I set the exact data ranges in my code. But I want to have the data range be columns I through N in the row that contains the active cell on sheet1. I think I have the right idea, but can't seem to make it work.
I have tried many different ways. For instance:
Setting the data series in the first chart using ActiveCell:
.SeriesCollection(1).Values = Worksheets("Sheet1").Range(Cells(ActiveCell.Row, 9), Cells(ActiveCell.Row, 16))
or setting variables:
Dim ar As String ' active row from sheet1
Dim rngData As Range ' Range of user data to be used from sheet1
ar = ActiveCell.Row
Set rngData = Worksheets("Sheet1).Range(Cells(ar, 9), Cells(ar, 16))
or this:
Dim RowNum As Integer ' Active row from sheet 1
Set RowNum = Worksheets("Sheet1").Cells(ActiveCell.Row)
I'm such a beginner! Any ideas?