Solved

removing tick marks and line from axis

Posted on 2013-10-24
5
824 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
  • 3
5 Comments
 
LVL 9

Expert Comment

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

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 80

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 80

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now