dan_l
Active Member
What oh what am I missing here:
Dim sourceh As Integer
Dim sourcew As Integer
sourceh = Range("chartsource").Rows.Count
sourcew = Range("chartsource").Columns.Count
Sheets("test").Range(Cells(1, 1), Cells(sourceh, sourcew)).Value = Sheets("sheet2").Range("chartsource").Value
So on chart click vba will:
1. determine the size of the source data (this isn't very slick, it's just a named range called 'chart source')
2. Copy the range to an equally sized range on another sheet
This works when the destination sheet is active(in this case, test) but throws a error 1004 any other time.
What did I miss?
Dim sourceh As Integer
Dim sourcew As Integer
sourceh = Range("chartsource").Rows.Count
sourcew = Range("chartsource").Columns.Count
Sheets("test").Range(Cells(1, 1), Cells(sourceh, sourcew)).Value = Sheets("sheet2").Range("chartsource").Value
So on chart click vba will:
1. determine the size of the source data (this isn't very slick, it's just a named range called 'chart source')
2. Copy the range to an equally sized range on another sheet
This works when the destination sheet is active(in this case, test) but throws a error 1004 any other time.
What did I miss?