ExcelNoob222
Board Regular
- Joined
- Jun 17, 2020
- Messages
- 77
- Office Version
- 365
- Platform
- Windows
Hi,
I have the below code that sets my chart range to the last row. However my data will not always go to column J, it could change to M, N etc. How do I adjust the code so that it grabs the last row and last column?
Thanks!
I have the below code that sets my chart range to the last row. However my data will not always go to column J, it could change to M, N etc. How do I adjust the code so that it grabs the last row and last column?
Thanks!
VBA Code:
LastRow = Range("A" & Rows.Count).End(xlUp).Row
ActiveSheet.ChartObjects("Chart 17").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:=Sheets("Seasonality").Range("A2:J" & LastRow)