?
Solved

removing tick marks and line from axis

Posted on 2013-10-24
5
Medium Priority
?
1,485 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 1500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
New style of hardware planning for Microsoft Exchange server.
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

809 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