Hello,
I need a code to read and replace the values and xvalues of a chart series, specifically the row numbers. Can someone help? By now, the code I have doesn't get the values and xvalues as msgbox is a blank.
Thank you
I need a code to read and replace the values and xvalues of a chart series, specifically the row numbers. Can someone help? By now, the code I have doesn't get the values and xvalues as msgbox is a blank.
Code:
Sub test()
Dim cht As ChartObject
Dim srs As Series
Dim sht As Worksheet
Dim rng As String
Dim rngx As String
Dim i As Long
Dim j As Long
Set sht = ThisWorkbook.ActiveSheet
For Each cht In sht.ChartObjects
cht.Activate
For i = 1 To ActiveChart.SeriesCollection.Count
With ActiveChart.SeriesCollection(i)
.XValues = rngx
.Values = rng
MsgBox rngx 'returns a blank
'after this fixed I need to get the first and last rows of Xvalues and Values and be able to replace them maybe with the replace function!!!
End With
Next i
Next cht
End Sub
Thank you