Solved

Creating a simple barChart using current region

Posted on 2014-02-11
2
149 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 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

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

726 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