about chart and graph in Excel

A

Amit

Hello,

Let's say I'm having a sheet with following data in two columns:

1 100
2 200
3 300
4 400

when I graph it in Chart1. The bar which belongs to 100 places in the
right most part of the graph and 400 places next to 0 or origin. How
this happens?

Code:

Dim TheChart As Chart
Dim DataSheet As Worksheet
Dim CatTitles As Range
Dim SrcRange As Range
Dim SourceData As Range
Dim iBarIndex As Integer

Set TheChart = Sheets("Chart1")
Set DataSheet = Sheets("Sheet1")

With DataSheet
'Set CatTitles = .Range("A1:A4")
Set SrcRange = .Range(Cells(1, Item), .Cells(4, Item))
End With

'Source Data
'Set SourceData = Union(CatTitles, SrcRange)

With TheChart
.Activate
.SetSourceData Source:=SrcRange, PlotBy:=xlRows 'SourceData
.Deselect

End With
 
M

mcescher

This is a group that discusses Microsoft Access, the database program.
I suggest you submit your question to an Excel group.

Chris M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top