Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6974043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:11:10+00:00 2026-05-27T17:11:10+00:00

I need to plot a line graph of a set of data. I know

  • 0

I need to plot a line graph of a set of data. I know the column containing the time series (C26 to the bottom) and I’ll know the column of the data from the button calling it and the row the data starts in (26). The labels will be in row 26. The button will be in row 24. The data contains no blank spaces.

The graph needs to have the data label in. Here’s how far I’ve got, any suggestions, please let me know! At the moment it only plots 1 against the time axis.

Sub GraphTest()
Dim xaxis As Range
Dim yaxis As Range
Dim fullRange As Range
Dim topcell As Range
Set xaxis = Range("$B$26", Range("$B$26").End(xlDown))
Set yaxis = ActiveSheet.Buttons(Application.Caller).TopLeftCell
Set yaxis = Range(Cells(yaxis.Row, yaxis.Column).Offset(2, 0), Cells(yaxis.Row, yaxis.Column).Offset(2, 0).End(xlDown))
Set topcell = ActiveSheet.Buttons(Application.Caller).TopLeftCell

Set fullRange = Union(xaxis, yaxis)
fullRange.Select
topcell.Activate
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=fullRange
End Sub()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:11:11+00:00Added an answer on May 27, 2026 at 5:11 pm

    Never got this to work too well, but here’s the solutions I’ve had to go with,

    Sub Graph()
    Dim xaxis As Range
    Dim yaxis As Range
    Dim temp As Range
    
    Dim total As Range
    
    Set yaxis = ActiveSheet.Buttons(Application.Caller).TopLeftCell
    yaxis.Select
    
    Set yaxis = Range(Cells(yaxis.Row, yaxis.Column), Cells(yaxis.Row, yaxis.Column))
    yaxis.Select
    Set temp = yaxis
    
    yaxis.Offset(2, 0).Select
    
    ActiveCell.Activate
    ActiveCell.Select
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Activate
    Loop
    Set yaxis = Range(yaxis.Offset(2, 0), ActiveCell.Offset(-1, 0))
    yaxis.Select
    
    Range("$b$26").Activate
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Activate
    Loop
    Set xaxis = Range("$b$26", ActiveCell.Offset(-1, 0))
    xaxis.Select
    Set total = Union(xaxis, yaxis)
    total.Select
    temp.Offset(2, 0).Activate
    temp.Select
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.ChartType = xlXYScatterLines
    ActiveChart.SetSourceData Source:=total
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to read some data from an input file and plot a graph
I need to plot non-numeric data against dates as a simple line graph. I
I need to plot a time series with ggplot2. For each point of the
I need to plot a number of time series of different frequencies in R,
I need plot a curve for my data , the source is like :
I have data with a best fit line draw. I need to draw two
I'm trying to plot two sets of data wrt to time on the same
I need to plot a bar chart showing counts and a line chart showing
I need to plot discrete X,Y data as a MAP in a PNG or
I'm looking for a way to plot a bar chart containing two different series,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.