Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Slightly Urgent: Problem Resetting Chart Value Ranges
WITH APOLOGIES FOR RE-POSTING, PUT IT IN CHARTS ORIGINALLY AND GOT NO
RESPONSES. I have a macro that is supposed to reset three data ranges (one X, two Y) based on the number of data rows in the current worksheet. The first two work fine, the third one errors out, saying it is "unable to set the Values property of the Series class." I'm I'm darned if I can see why, as the code seems identical to the two previous lines. The code follows, and below that a sample of the data it's referring to: Sheets("S-curve Chart").Select ActiveChart.ChartArea.Select ##works## ActiveChart.SeriesCollection(1).XValues = "='S-curve Chart Data'!R2C1:R" & Chart6LastRow & "C1" ##works## ActiveChart.SeriesCollection(1).Values = "='S-curve Chart Data'!R2C3:R" & Chart6LastRow & "C3" ##fails## ActiveChart.SeriesCollection(2).Values = "='S-curve Chart Data'!R2C5:R" & Chart6LastRow & "C5" ActiveChart.Deselect Here's a few rows of the data from the worksheet. The code is referring to columns A, C, and E, and further down, Col E DOES have data in it. I thought the latter (i.e., nulls in the first several rows) might be causing the error, but filling Col E with zeroes or other values didn't help. ColA ColB ColC ColD ColE 181 $0 $0 $- 180 $- $0 $- 179 $- $0 $- 178 $- $0 $- 177 $- $0 $- 176 $- $0 $- 175 $- $0 $- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Slightly Urgent: Problem Resetting Chart Value Ranges
(Stupid question, I know, but it can't hurt...) And you know that the chart
you are trying to modify already has two y-variables set up? I'm not sure if it would screw up if you didn't have a second series previously set up, but maybe it's a shot (in the dark, *cough*). Jim -- I appreciate any feedback. Please don''t be scared to say that "Yes" I/someone else did answer your question. Thank you. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Slightly Urgent: Problem Resetting Chart Value Ranges
Yes, this is an existing chart with an X and two Y's. Didn't want to muddy
the water with too much information before, but this is all contained in a humongous macro-rich workbook that serves as a template for numerous users. The user imports from a raw data file (Excel), does a whole series of things to it, and one of several results is the data in the worksheet that feeds this chart. And wouldja believe, with some source files it works and with some (or at least one!), the aforementioned error occurs. The infamous Column E, which appears to be the root of the problem, starts out with formulas all the way down, but to prevent Excel from charting zeroes, the very last VBA step just before trying to reset the chart series evaluated the whole column and sets everything that isn't a valid, 0 number to null. Don't know if that will ring any Aha! bells, but I sure appreciate your sticking with me through all this. "J Sedoff" wrote: (Stupid question, I know, but it can't hurt...) And you know that the chart you are trying to modify already has two y-variables set up? I'm not sure if it would screw up if you didn't have a second series previously set up, but maybe it's a shot (in the dark, *cough*). Jim -- I appreciate any feedback. Please don''t be scared to say that "Yes" I/someone else did answer your question. Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem Resetting Data Source Ranges via VBA | Charts and Charting in Excel | |||
Slightly OT (Maybe) printing problem | Excel Worksheet Functions | |||
URGENT: Using Named Ranges with Chart Wizard | Excel Worksheet Functions | |||
URGENT! Need help on resetting an array | Excel Discussion (Misc queries) | |||
Resetting chart ranges | Excel Programming |