Solved

Creating a simple barChart using current region

Posted on 2014-02-11
2
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
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…

707 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