Solved

removing tick marks and line from axis

Posted on 2013-10-24
5
860 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

895 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

11 Experts available now in Live!

Get 1:1 Help Now