-
Solved: VBE to change Line Chart Height based on number of Rows
I have a Line Chart that uses Names Ranges as the Source(s) because the number of entries (rows) can vary greatly in my data set (anywhere from 10 to 100 entries/rows).
How can I have the Line Chart expand down as more entries are entered?
The Chart will show the new entries but you cannot read the Labels beacuse they are to small and appear almost on top of each other becasue the Chart does not "physically" expand down automatically.
Is there a way to have a chart's physical "size" change automatically to allow for new entries so that the Labels are readable?
ie: overall chart height = .x for each row, where x is a constant height setting?
Thanks for any and all help...
Jim
-
-
A simple example saves us from having to create a workbook trying to replicate your problem.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
Here's an example of the data.
The number of rows can vary.
-
here's one idea, but I'd like to see if a method exists that doesnt need to refer to the data sheet...
[vba]
Public Sub expandChartToRows()
With ActiveSheet.ChartObjects(1)
.Height = (ThisWorkbook.Sheets("Data1").UsedRange.Rows.Count + 10) * 14
End With
End Sub
[/vba]
-
This will work - Thank you very much....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules