+ Reply to Thread
Results 1 to 4 of 4

Creating a macro that graphs data at different times relative to specific condition

  1. #1
    Registered User
    Join Date
    07-14-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    30

    Creating a macro that graphs data at different times relative to specific condition

    Hello, I'm able to manually graph various data points that correspond to a specific condition however I don't know how to write a macro that can do this for me automatically.
    I want to graph the data set that corresponds with the condition from condition 5 and above and ignore the rest of the conditions.
    If you can help me do this with a command button that would be greatly appreciated!!
    Attached Files Attached Files

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

    Re: Creating a macro that graphs data at different times relative to specific condition

    Are you required to use a VBA + command button for this? I would approach something like this without VBA by:

    A) Create a chart that uses all of the table, then use autofilter to filter the data by condition (if your chart's hidden and empty cells setting is set to ignore, then the chart will not show the hidden values).

    B) Use a helper column with a formula like =IF($F$1=$B2,C2,NA()) in F2 and copied into F2:G11, then build the chart on these two helper columns. Now I can enter my condition in F1, and the chart will show only the data corresponding to that condition.

    Will either of those work, or are you required to use VBA for this?
    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
    07-14-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    30

    Re: Creating a macro that graphs data at different times relative to specific condition

    I tried both method's and they seem to do what I want but I just need to mess around with it a little more to get a better grasp of how to do it efficiently. I was told to use VBA but with the information you gave me I imagine that recording a macro could potentially work for this as well, is that the case? Thank you for your guidance it has given me a better understanding of how to approach the problem.

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

    Re: Creating a macro that graphs data at different times relative to specific condition

    I'm sure a macro could be written. VBA can do almost everything that you can do manually in Excel. I don't see what advantage VBA brings to the problem using either of these approaches, but that doesn't mean it could not be done.

+ 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. Help creating a macro that reads the conditional number and graphs the corresponding data
    By cheeseleweese in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2020, 03:37 PM
  2. Creating Multiple Countdown Clocks to specific times
    By shanic in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2019, 04:27 AM
  3. Creating the same graphs from several different data sources
    By Dishwalla_D in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2017, 01:42 PM
  4. [SOLVED] Find specific value in array which appears multiple times and average all relative cells
    By nenadmail in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-24-2014, 04:18 PM
  5. Relative Cell References when creating VBA Macro for Chart
    By BHcristo in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 12-04-2010, 10:13 AM
  6. Macro Loop – Find Specific Times, Extract Date, Average Values of Times
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-25-2010, 02:50 PM
  7. Macro for creating named ranges from relative referencing
    By parodytx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2008, 01:00 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