Solved

Creating a simple barChart using current region

Posted on 2014-02-11
2
148 Views
Last Modified: 2014-02-12
Dear Experts:

I would like to create a bar chart using VBA with the following requirements

The range is to be the current region (starting from range("C2"))

The Chart is to be a bar chart (xlBarClustered) to be placed on the currently active sheet

No major gridlines on the value axis, no MajorTickMarks on the Category Axis.

No legend

Help is very much appreciated.

Thank you very much in advance.  

Regards, Andreas
0
Comment
Question by:AndreasHermle
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39850807
HI,

Wihtout more detail I'm stuck with that

Sub Macro1()
'

    Set shp = ActiveSheet.Shapes.AddChart
    shp.Chart.ChartType = xlBarClustered

    shp.Chart.SetSourceData Source:=Range("Sheet1!" & Range("C2").CurrentRegion.Address)
    shp.Chart.Axes(xlValue).MajorGridlines.Format.Line.Visible = msoFalse
    shp.Chart.Axes(xlValue).MajorTickMark = xlNone

End Sub

Open in new window

Regards
0
 

Author Closing Comment

by:AndreasHermle
ID: 39853679
HI Rgonzo:

this did the trick, thank you very much for your great help. I really appreciate it.

Regards, Andreas
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

828 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