Solved

removing tick marks and line from axis

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
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.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

815 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

8 Experts available now in Live!

Get 1:1 Help Now