excel - Change the SetSourceData range when chart is created -


I have some VB coding that hides the rows above and below the required cell values, which are simple for source data The line chart will be used as

How can I select the remaining (non-hazardous) cell range as my set-source range?

I can select the category with the following ...

  Range ("D6") Offset (1, 0). Select range (selection, selection. End (xlDown))   

Choose ... Category always starts in cells below cell C6.

When I try to use it as my SetSourceData category ...

  ActiveSheet.Shapes.AddChart. Select ActiveChart.SetSourceData Source: Range ("D6") Offset (1, 0) .Select.Range (selection, selection. End (xlDown)). Select ActiveChart.ChartType = xlLine   

... I get the following error:

Run-time error '438': object does not support this property method

Any thoughts?

Thank you


Actually, the following code selects the data which makes me a little better ...

range (" D7 ", cell (lines count," D "). End (xlUp)). Specialcale (xlCellTypeVisible) Select

... But, how do I use it as a data source for my chart?

Sorry, the code after creating a more effective selection ... range ("D7", cell (Rows, seat, "D"). End (XLEP)). Special Seals (xlc type type) Select

... I realized what I had to do, to remove code as a chart data source, '.select' was removed from the code! !!!

  ActiveSheet .Shapes.AddChart. Select ActiveChart.SetSourceData Source: = Category ("D8", Cell (Rows of Seat, "D"). End (XLEEP)). Special Seals (XLSLProView) ActiveChart.ChartType = xlLine   

runs right now.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -