+ Reply to Thread
Results 1 to 3 of 3

Does MS Excel allow data to be plotted from variables inside VBA directly?

  1. #1
    Registered User
    Join Date
    10-03-2022
    Location
    England
    MS-Off Ver
    365
    Posts
    7

    Does MS Excel allow data to be plotted from variables inside VBA directly?

    Usually when we plot graph in MS Excel we start with numbers inside a spreadsheet. We then select these numbers and then select a graph type to plot the data. This means that ever single value being plotted must be present inside cells in a spreadsheet.

    VBA can have values stored inside variables. This is akin to how it works with Python or MATLAB. In the Python and MATLAB we can provide the data be plotted as parameter into a function and the graph will be created. Is the same possible with Excel VBA as well? In other words, can I have data inside Excel VBA variables and plot graph directly from them without having the values inside a spreadsheet? Or must I first write the values from VBA into a spreadsheet and then invoke the command which shall plot the data?

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,858

    Re: Does MS Excel allow data to be plotted from variables inside VBA directly?

    To my knowledge, there is no way for Excel to graph data stored in a VBA array. If you don't want to write the data into a spreadsheet for charting, you can store the data inside of the chartseries definition as an Excel array constant.

    IMO, by far the easiest way to chart data in a spreadsheet is to write the data into the spreadsheet, then use that range for the chart data. What is your motivation to avoid writing data into the spreadsheet?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    10-03-2022
    Location
    England
    MS-Off Ver
    365
    Posts
    7

    Re: Does MS Excel allow data to be plotted from variables inside VBA directly?

    There is no motivation to not write into spreadsheet. I have used Python and MATLAB in the past and assumed that I could just graph data from variables in Excel VBA as well. However, I have now discovered that this is not the case.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA script - fbl3n data from sap to excel directly
    By joseferreira in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2021, 01:46 PM
  2. Please help - Producing a plotted graph in Excel 2016 for given data
    By gautambangalore in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 06-12-2018, 08:18 AM
  3. [SOLVED] Can system variables be used inside Excel
    By John F in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2006, 06:15 PM
  4. Replies: 0
    Last Post: 02-21-2006, 12:40 PM
  5. Can you FTP a file/data directly into Excel
    By TDR in forum Excel General
    Replies: 1
    Last Post: 08-10-2005, 10:05 AM
  6. Chart with a plotted point inside an envelope.
    By fewest in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-23-2005, 12:05 PM
  7. [SOLVED] Excel Charts - Data being Plotted beyond Primary X-Axis Scale
    By Yvonne Fochesato in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-30-2005, 11:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1