0

I'm trying to create a function where I can identify the chart I intend to populate on Sheet1. The chart will get its x-values and y-values based on a structured reference.

For example:

addTrend("Chart1","Sheet1",MyDataTable[MyXDataHeader],MyDataTable[MyYDataHeader])

I have been at this for hours and I cannot seem to find any available resources on how to

  • handle structured references in a user defined function and
  • get the desired data sources into the chart?
2
  • You are trying to populate a chart using a cell formula? A UDF cannot change the contents of cells or charts. What you need to do is write VBA code that does what you want, and trigger the code with a button. Commented Nov 19, 2021 at 9:20
  • I have been able to alter charts with a UDF. In this instance I generate a string of the range I intend to use in the chart. cht.SeriesCollection(n).XValues = "=" & XValuesRng Commented Nov 19, 2021 at 13:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.