LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default 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?



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating graphs in VBA nir020 Excel Programming 0 February 2nd 09 05:46 PM
Creating Multiple Graphs at a Time Matt Carney Charts and Charting in Excel 2 May 27th 08 05:08 AM
Creating two bar graphs Lisa Charts and Charting in Excel 3 December 6th 05 01:41 PM
CREATING GRAPHS Mohammad Mian Excel Programming 4 August 9th 04 12:58 PM
Need Help creating multiple graphs through coding canes_26 Excel Programming 2 April 28th 04 09:00 AM


All times are GMT +1. The time now is 04:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"