Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Chart Help

Status
Not open for further replies.

cfash

Programmer
Joined
Nov 22, 2000
Messages
8
Location
US
I am trying to create a chart from a multiple range. I want the multiple range to be contained in one series, but I must be missing something. Each column in the range is being interpreted as a new series. I have tried two ways of making the range from multiple columns.

1. xlWsheet.Range("A8:A19,C8:C19,E8:E19")
2. myRange = Union(r1,r2)
xlWsheet.Range(myRange)

VB thinks that there are 3 series. One for A,C, and E. I just want one series with the data from all three. Has anyone else had this problem or does anyone know how I can solve this problem?

Any help is appreciated.

Chris


 
Example :

Set xlApp = CreateObject("Excel.Application")

With xlApp
.Visible = True
.Workbooks.Add
Set xlWrk = .ActiveSheet
With xlWrk
.Paste

' .Range("A2").FormulaR1C1 = "=RC[4]&"" ""&RC[2]&"" ""& RC[1]"
' .Range("A2:A" & i).FillDown
' .Range("B:C,E:E").EntireColumn.Hidden = True


For x = 2 To i
.Range("F" & x).Value = .Range("A" & x).Value & " " & .Range("C" & x).Value & " " & .Range("B" & x).Text
If Len(Trim(.Range("F" & x).Text)) = 0 Then
.Range("F" & x).EntireRow.Hidden = True
End If
.Range("G" & x).Value = .Range("D" & x).Value
Next x
.Range("G1").Value = .Range("D1").Value

.Range("F1").CurrentRegion.Select
End With
End With
Set xlGraph = xlApp.Charts.Add()
' xlGraph.Type = 4 '(=xlLine constante in Excel97)
xlGraph.ChartType = 51 '(xlColumnClustered Excel constante)
xlApp.commandbars("Chart").Visible = False
' xlWrk.Visible = False
Set xlWrk = Nothing
Set xlGraph = Nothing
Set xlApp = Nothing Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX.

Download Demo version on my Site:
Promotions before 02/28/2001 (free source codebook),visite my site
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top