+ Reply to Thread
Results 1 to 1 of 1

VBA script to Automatically Plot Scatter Plots after scanning workbook for valid data

  1. #1
    Registered User
    Join Date
    05-20-2020
    Location
    USA
    MS-Off Ver
    10
    Posts
    28

    VBA script to Automatically Plot Scatter Plots after scanning workbook for valid data

    Hello All,

    I am attempting to automatically plot scatter plots on each tab in an excel workbook. I wanted some help in scanning each worksheet to see if data is present, then plot the scatter plot based on the number of valid data found. For example, in this spreadsheet:


    Screenshot 2021-01-14 134044.png

    There is 2 valid data sets. The data is always in the same type of format. Each dataset is separated by 5 columns....in this example, the first data set is at A and then G. This worksheet should produce 2 plots on the graph using Amp1 and Amp 2 as the x and y data respectively. The plot should look like this:

    Screenshot 2021-01-14 135339.png


    Once Row 1 separated by 5 columns have an entry, that is considered a valid plot. From the table presented, A28:A41 is the first x data and B28:B41 as the first y data, then switch to Plot 2 as column G1 has data using G28:G41 as the second x data and H28:H41 as the corresonding second y data.

    Other worksheets may have a different number of valid data. Sheet 1 may have 4 sets, Sheet 2 may have just 1.

    How to accomplish this task of plotting the scatter plots for each tab with different number of plots?

    I was only able to come up with hard coding the plotting:

    VBA Code:

    Please Login or Register  to view this content.




    Thanks!
    Attached Files Attached Files
    Last edited by jimjones1958; 01-14-2021 at 11:12 PM.

+ 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. [SOLVED] Automatically updating a scatter plot with customized data points based on x-y- results
    By jojorabbit in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-14-2020, 09:16 AM
  2. [SOLVED] macro to plot connected scatter plots
    By anupsubudhi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2018, 07:54 PM
  3. XY scatter plot: Third variable determines color of plots/line
    By DudeHey in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-16-2013, 02:33 AM
  4. Automate to plot 1,000 plus scatter plots
    By mollwollfumble in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2012, 08:21 PM
  5. Replies: 1
    Last Post: 06-05-2012, 03:20 AM
  6. Automatically Referencing Data Ranges In An Excel Scatter Plot
    By groovymoon in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 12-07-2010, 09:07 AM
  7. [SOLVED] Excel gives me line plots - I want scatter plots
    By Pangloss in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-14-2005, 10:05 AM

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