Selecting Graph Range from specific cell until the end of that column

dodo2407

New Member
Joined
Jul 27, 2022
Messages
2
Office Version
  1. 2021
Platform
  1. Windows
Hello,

I'm having trouble making a graph which requires me to do a union range where I want the data to be from a specific cell and cover all the data underneath it, in this same column.
I would appreciate any help :)

Code:

Sub CreateChartDigital()

Dim ch As Chart


Sheet1.Select
Union( _
Range("A1").End(xlDown)), _
Range("N1").End(xlDown)), _
Range("S1").End(xlDown)), _
Range("AS1").End(xlDown))).Select

Charts.Add2

Set ch = Charts.Add2

ch.ChartType = xlLine
ch.HasLegend = True
ch.HasTitle = True
ch.ChartTitle.Text = "Digital Data"
ch.Axes(xlCategory).HasTitle = True
ch.Axes(xlCategory).AxisTitle.Text = "Time (ms)"
ch.Axes(xlValue).HasTitle = True
ch.Axes(xlValue).AxisTitle.Text = "Pressure (mbar)"
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top