scolty1985
Board Regular
- Joined
- Sep 16, 2009
- Messages
- 88
Good afternoon all, I was hoping someone would be kind enough to help me with this wee problem.
Im trying to write a VBA program which will automatically create a histogram for me. I already have an example for plotting an XY scatter which im trying to modify but thus far with no success.
Issues:
1) Im not sure what the syntax is for creating a histogram
2) Im not sure how to use the existing example i have so it references an undisclosed number of rows in a column.
The existing code i have, written by someone here i believe, is as follows:
I usually use the following:
To store the number of rows in a column. I dont know how i can use that in a range though, ie
...Range("H2: H(LC)").ch....
If someone could also comment on the correct syntax for a historgram so i can replace the line
I would appreciate it.
Rgds
Scolty
Im trying to write a VBA program which will automatically create a histogram for me. I already have an example for plotting an XY scatter which im trying to modify but thus far with no success.
Issues:
1) Im not sure what the syntax is for creating a histogram
2) Im not sure how to use the existing example i have so it references an undisclosed number of rows in a column.
The existing code i have, written by someone here i believe, is as follows:
Code:
With Worksheets("Sheet3").ChartObject.Add _
(Left:=200, Width:=400, Top:=250, Height:=225)
.Chart.SetSourceData Source:=Worksheets("DataSheet").Range("H2:H6")
.Chart.ChartType = xlXYScatterLines
I usually use the following:
Code:
LC = Range("A" & Rows.Count).End(xlUp).Row
To store the number of rows in a column. I dont know how i can use that in a range though, ie
...Range("H2: H(LC)").ch....
If someone could also comment on the correct syntax for a historgram so i can replace the line
Code:
Chart.ChartType = xlXYScatterLines
I would appreciate it.
Rgds
Scolty