sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,404
- Office Version
- 2016
- Platform
- Windows
I'm trying to set the source range of a chart to the last used row but I'm struggling, this is what I have so far;
The code is highlighted red and I've made a number of tweaks but can't get it to work - can someone please put me out of my misery?
VBA Code:
LastRow = Sheet5.Range("A65536").End(xlUp).Row
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData source:=Range("B1:B" & LastRow",D1:D" & LastRow",F1:F" & LastRow",H1:H" & LastRow",J1:J" & LastRow",L1:L" & LastRow",N1:N" & LastRow",P1:P" & LastRow"")
The code is highlighted red and I've made a number of tweaks but can't get it to work - can someone please put me out of my misery?