+ Reply to Thread
Results 1 to 2 of 2

Macro insert limits in graph

  1. #1
    Registered User
    Join Date
    10-26-2015
    Location
    Antwerp
    MS-Off Ver
    2010
    Posts
    5

    Macro insert limits in graph

    Hi all,

    I want to make a macro that inserts upper and/or lower limits in a graph.
    For example when I insert in a textbox: 100
    I want a horizontal line in my graph with y=100 (if possible a line that fits the range of my dataset)

    This is what I already did:
    I made a userform with 2 text boxes where i can enter an upper limit and lower limit and an ok button.
    Now I want to use this to make my limits


    I'm new to VBA, I think it should look like this:
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(1).Name = "=""UpperLimit"""
    ActiveChart.SeriesCollection(1).XValues = "=Tekstbox1.Value/Tekstbox1.Value" -> (error)
    ActiveChart.SeriesCollection(1).Values = "=0 until 'range of my data set' " -> ( No idea if this is possible)

    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(1).Name = "=""lowerLimit"""
    ActiveChart.SeriesCollection(1).XValues = "=Tekstbox2.Value/Tekstbox2.Value" -> (error)
    ActiveChart.SeriesCollection(1).Values = "=0 until 'range of my data set' " -> ( No idea if this is possible)

    When a textbox is empty -> dont plot a limit

    All help is welcome !

  2. #2
    Registered User
    Join Date
    10-26-2015
    Location
    Antwerp
    MS-Off Ver
    2010
    Posts
    5

    Re: Macro insert limits in graph

    Already solved

+ 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. Graph Y Axis Limits
    By medinno in forum Excel General
    Replies: 1
    Last Post: 09-28-2015, 12:49 PM
  2. [SOLVED] Macro Recorded formula limits
    By dlow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2014, 12:29 AM
  3. Macro limits the copying
    By carapins in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-23-2013, 01:03 PM
  4. Text Format in Macro Limits to 15 or Less Characters
    By Steve=True in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2013, 07:04 AM
  5. Macro to find value between two limits for a given condition
    By DamirDz in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-26-2013, 04:19 PM
  6. [SOLVED] Can you insert a graph inside another graph? if so how?
    By Jim Smith in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-08-2005, 11:05 AM

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