#1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 5
Default Y-axis tick marks

Hi all,

I'm pretty knew to Excel VBA and charting. I have a simple histogram
chart on a worksheet and the data ranges are 1 to 100. So Excel
automatically puts the Y-axis tick marks at 0, 20, 40, 60, 80, 100. But
I only want three tick marks to show on the Y-axis (0, 50, 100). How
can I do that?

Also is there a way to put a horizontal line at the 50 y-axis tick
mark that will show on top of my chart? My users want to be able to
quickly see the 50 line (i.e. which histogram bars extend above it, and
which ones don't reach it).

It would be great if I could programmatically do this in VBA code.

Thanks!
Brad

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Y-axis tick marks

Hi,

Double click the Y axis and on the Scale tab set the Major Unit value to 50.
If you want code use the macro recorder whilst you do this and then you
should get something like,

ActiveChart.Axes(xlValue).MajorUnit = 50

As for adding a datum line see here for examples.
http://www.andypope.info/charts/averageline.htm

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Brad Stone" wrote in message
...
Hi all,

I'm pretty knew to Excel VBA and charting. I have a simple histogram
chart on a worksheet and the data ranges are 1 to 100. So Excel
automatically puts the Y-axis tick marks at 0, 20, 40, 60, 80, 100. But
I only want three tick marks to show on the Y-axis (0, 50, 100). How
can I do that?

Also is there a way to put a horizontal line at the 50 y-axis tick
mark that will show on top of my chart? My users want to be able to
quickly see the 50 line (i.e. which histogram bars extend above it, and
which ones don't reach it).

It would be great if I could programmatically do this in VBA code.

Thanks!
Brad


  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 5
Default Y-axis tick marks

Thanks Andy! I have it working perfectly now thanks to your suggestions.

~Brad


Andy Pope wrote:

Hi,

Double click the Y axis and on the Scale tab set the Major Unit value to 50.
If you want code use the macro recorder whilst you do this and then you
should get something like,

ActiveChart.Axes(xlValue).MajorUnit = 50

As for adding a datum line see here for examples.
http://www.andypope.info/charts/averageline.htm

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Brad Stone" wrote in message
...
Hi all,

I'm pretty knew to Excel VBA and charting. I have a simple histogram
chart on a worksheet and the data ranges are 1 to 100. So Excel
automatically puts the Y-axis tick marks at 0, 20, 40, 60, 80, 100. But
I only want three tick marks to show on the Y-axis (0, 50, 100). How
can I do that?

Also is there a way to put a horizontal line at the 50 y-axis tick
mark that will show on top of my chart? My users want to be able to
quickly see the 50 line (i.e. which histogram bars extend above it, and
which ones don't reach it).

It would be great if I could programmatically do this in VBA code.

Thanks!
Brad


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
monthly separation tick marks on x-axis Rab Charts and Charting in Excel 11 May 15th 23 11:45 AM
x axis tick marks Buckeye5 Charts and Charting in Excel 3 February 8th 07 11:27 PM
Tick marks ofey New Users to Excel 5 November 21st 05 06:32 PM
Y-axis tick marks in middle of chart? Ed Charts and Charting in Excel 6 May 26th 05 01:16 PM
Need specific tick marks on Y axis myhounds Charts and Charting in Excel 1 March 26th 05 06:59 AM


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

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

About Us

"It's about Microsoft Excel"