Solved

Creating a simple barChart using current region

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

746 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

9 Experts available now in Live!

Get 1:1 Help Now