Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old November 10th 12, 02:09 PM posted to microsoft.public.excel.charting
external usenet poster
 
First recorded activity by ExcelBanter: Nov 2012
Posts: 5
Default Align x axis labels at 45 degrees using vba, please help!

Been trying to figure out how to do this for hours now I have run out of ideas.

I have managed to select the labels using the following code:


' add the chart
Set myChtObj = ActiveSheet.ChartObjects.Add(Left:=300, Width:=800, Top:=75 Height:=400)

With myChtObj.Chart
.Axes(xlCategory).TickLabelPosition = xlTickLabelPositionLow
.Axes(xlCategory).TickLabels.Select
End With

My usual way to find out how to do stuff like this is to record a macro then look at the code but the macro is not picking it up at all.

I checked the VBA help and it helpfully gives the syntax as follows:

TickLabels.Alignment Property (Excel)

Returns or sets a Long value that represents the alignment for the specified phonetic text or tick label.

Syntax


expression.Alignment

expression A variable that represents a TickLabels object.

See Also


Concepts

TickLabels Object
TickLabels Object Members

Only problem is (not so helpfully!) it does not work!!!

It may be that this is a bug in the pprograme, which would be a shame as I really want my chart a certain way and to build it with code, if anyone has any knowledge of how to do it or get round it or even knows for sure it is impossible I would be very grateful.

Kind regards, Mark


Reply
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
Align Y axis labels cobra15 Charts and Charting in Excel 1 February 2nd 10 09:59 AM
How to align the series with the-x axis labels? Karen Excel Discussion (Misc queries) 1 November 20th 06 10:26 PM
How do I align x-axis labels in excel? Cust.Sat.Info Charts and Charting in Excel 2 August 25th 05 03:08 PM
Align Clustered Column Chart Category Axis Labels Stephanie Charts and Charting in Excel 1 April 7th 05 03:21 PM
Allow Excel to orient/align text 180 degrees QuadJoe4x4 Excel Discussion (Misc queries) 2 January 7th 05 12:40 AM


All times are GMT +1. The time now is 06:40 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017