Hi Guys,
Been trying to get this to work:
Sub Align_Chart_To_Cells()
Dim max As Integer, j As Double
Dim csh As Shape
Dim chrt As Chart
Dim xx As Axis
Set chrt = ActiveChart
Set csh = ActiveSheet.Shapes(right(chrt.Name, Len(chrt.Name) - Len(ActiveSheet.Name) - 1))
csh.TopLeftCell.Activate
Set xx = chrt.Axes(xlValue, xlPrimary)
csh.left = ActiveCell.left - chrt.Axes(xlCategory).left - 4
csh.Top = ActiveCell.Top
max = InputBox("How Many x axis categories are there?")
Set xx = chrt.Axes(xlCategory)
j = 0
For i = 0 To max - 1
j = Round((12.75 * 3) / (1.71 * 4), 2)
ActiveCell.ColumnWidth = (chrt.Axes(xlCategory).Width / max) / j
ActiveCell.Offset(0, 1).Activate
Next i
End Sub
The idea is to match the category x-axis boundries to cell boundries - secondry axis charts, i put in extra blank data series to align everything (gap and overlap are useless). Data tables show the blank series data so macro to align the thing to cells easier to write a table below it without fiddling with column widths.
Any Ideas?