Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA code problem

Please help me. I'm banging my head against the wall with this one
Range C33 is 12 and D33 is 24, both are variables

Why this one doesn't work? the prolem is with the data source

Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceDat
Source:=Sheets("sheet1").Range(Range("C37").Offset (Range("C33"), 0)
Range("C37").Offset(Range("D33"), 2)), PlotBy :=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="sheet2"

And this one does?

Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceDat
Source:=Sheets("sheet1").Range("C49:E61")PlotBy :=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="sheet2"


The chart source area is this:

Range(Range("C37").Offset(Range("C33"), 0)
Range("C37").Offset(Range("D33"), 2))

This works fine in example 1:

Range(Range("C37").Offset(Range("C33"), 0)
Range("C37").Offset(Range("D33"), 2)).Select
With Selection.Interior
.ColorIndex = 5
.Pattern = xlSolid
End With

So my question is why the same area defining doesn't work in creatin
the chart that works in example 1?

Thank you for your hel

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alt Code Problem aftamath77 Excel Discussion (Misc queries) 2 February 10th 09 11:42 PM
Code problem Ruben Excel Discussion (Misc queries) 4 August 26th 08 08:22 AM
XLS to CSV Code Problem carl Excel Worksheet Functions 0 March 28th 07 01:21 AM
vba code problem sarasa[_8_] Excel Programming 0 June 15th 04 12:33 AM
vba code problem Steve Excel Programming 3 November 26th 03 10:51 AM


All times are GMT +1. The time now is 04:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"