![]() |
Creating graphs in VBA
Did you try the macro recorder? This is messy, but it should give you the
syntax you need: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 2/2/2009 by Jon Peltier ' ' ActiveChart.Axes(xlValue).Select Selection.TickLabels.AutoScaleFont = True With Selection.TickLabels.Font .Name = "Arial" .Size = 8 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic .Background = xlAutomatic End With ActiveChart.Axes(xlCategory).Select Selection.TickLabels.AutoScaleFont = True With Selection.TickLabels.Font .Name = "Arial" .Size = 8 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic .Background = xlAutomatic End With End Sub This can be changed to the following and inserted in your original routine: c.Axes(xlValue).TickLabels.Font.Size = 8 c.Axes(xlCategory).TickLabels.Font.Size = 8 - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services, Inc. http://PeltierTech.com/WordPress/ _______ "nir020" wrote in message ... I have used the folowing code to create a graph in VBA Sub Macro1() Dim c As Excel.Chart, a As Worksheet, co As ChartObjects Set a = Worksheets("Regional Issue Graphs") Set co = a.ChartObjects Set c = co.Add(60, 60, 300, 300).Chart co.Select c.ChartWizard Source:="North", HasLegend:=False however I am unable to write further code to which will allow me to alter the font size of the axies of the graph I want to create, can anyone help? |
All times are GMT +1. The time now is 01:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com