Hi All.
I'm trying to create a function that will place a chart directly below a given row on a worksheet. I've gotten close by using a for loop to load a variable (top) with the combined row height of all rows in a given range, then setting ActiveChart.Parent.top to that value.
---------------
For i = 1 To row + 6
top = top + Range(Cells(row - 1, 7), Cells(row + 6, 9)).Rows(i).RowHeight
Next
'then later...
With ActiveChart.Parent
.top = top ' reposition
End With
----------------
The problem is that rows(i).rowheight is not measured on the same scale as ActiveChart.Parent.top. I believe rowheight is based on points just as font size is, but I can't seem to find out what ActiveChart.Parent.top is based on. I need to know this to equate the two so that my chart positioning is precise and predictable. Right now it sort of drifts.
Any thoughts?
Thanks in advance.
James M.
I'm trying to create a function that will place a chart directly below a given row on a worksheet. I've gotten close by using a for loop to load a variable (top) with the combined row height of all rows in a given range, then setting ActiveChart.Parent.top to that value.
---------------
For i = 1 To row + 6
top = top + Range(Cells(row - 1, 7), Cells(row + 6, 9)).Rows(i).RowHeight
Next
'then later...
With ActiveChart.Parent
.top = top ' reposition
End With
----------------
The problem is that rows(i).rowheight is not measured on the same scale as ActiveChart.Parent.top. I believe rowheight is based on points just as font size is, but I can't seem to find out what ActiveChart.Parent.top is based on. I need to know this to equate the two so that my chart positioning is precise and predictable. Right now it sort of drifts.
Any thoughts?
Thanks in advance.
James M.