Hi, ive used some code from a youtube video ive found and altered it to fit my data range. However, the chart is now calculating all the blank cells beneath it. I'm very new to all this and so not entirely sure what I'm doing. Any help would be greatly appreciated. Here's the code before:
Dim chtobj As ChartObject
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Set chtrng = Range("a1:c" & lr)
Set ChartArea = Range("c" & lr + 3 & ":h" & lr + 15)
ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
ActiveChart.SetSourceData Source:=chtrng
Set chtobj = ActiveChart.Parent
chtobj.Top = ChartArea.Top
chtobj.Left = ChartArea.Left
chtobj.Height = ChartArea.Height
chtobj.Width = ChartArea.Width
ActiveChart.ClearToMatchStyle
ActiveChart.ChartStyle = 209
And this is what I've changed as my data starts in h20, i20 and j20.
Dim chtobj As ChartObject
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Set chtrng = Range("h20:j20" & lr)
Set ChartArea = Range("c" & lr + 3 & ":h" & lr + 15)
ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
ActiveChart.SetSourceData Source:=chtrng
Set chtobj = ActiveChart.Parent
chtobj.Top = ChartArea.Top
chtobj.Left = ChartArea.Left
chtobj.Height = ChartArea.Height
chtobj.Width = ChartArea.Width
ActiveChart.ClearToMatchStyle
ActiveChart.ChartStyle = 209
Bookmarks