Solved

removing tick marks and line from axis

Posted on 2013-10-24
5
1,017 Views
Last Modified: 2013-10-28
I am able to remove the tick marks from an axis.  I can't seem to find the object that will change the line color - that is, the line color in the axis label and scale box.  I want no line.

The macro recorder is not help (surprise!)
0
Comment
Question by:gofasteddie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 9

Expert Comment

by:jsdray
ID: 39598520
right click on it and click format axis
0
 
LVL 81

Expert Comment

by:byundt
ID: 39598562
My guess is that you have Excel 2007, in which the macro recorder notoriously doesn't record any chart actions at all.

Here is how you might do it in Excel 2013:
Sub NoTicks()
With ActiveSheet.ChartObjects("Chart 1").Chart
    .Axes(xlValue).MajorTickMark = xlNone
    .Axes(xlValue).MinorTickMark = xlNone
    .Axes(xlCategory).MajorTickMark = xlNone
    .Axes(xlCategory).MinorTickMark = xlNone
End With
End Sub

Open in new window

0
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39598583
And to remove the lines for the axes:
Sub NoLines()
With ActiveSheet.ChartObjects("Chart 1").Chart
    .Axes(xlValue).Format.Line.Visible = msoFalse
    .Axes(xlValue).Format.Line.Visible = msoFalse
End With
End Sub

Open in new window

0
 

Author Comment

by:gofasteddie
ID: 39600444
Thanks for your help, experts.  Yes, Excel 2007 VBA.

I tried a couple more things.  Using the Format, Shape Styles option, I discovered that the object/shape  is called "Subtle Line."

Hope that helps you drill down.
0
 
LVL 81

Expert Comment

by:byundt
ID: 39600458
gofasteddie,
While I understand that you want a VBA macro to format a chart a certain way, I'm not understanding your new question.

Could you post a "before and after" version of the chart? That way, we could test the code's ability to replicate the "after" appearance.

Brad
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My experience with Windows 10 over a one year period and suggestions for smooth operation
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question