I would like to update the data range in a chart by running a macro. Currently the data range is this "=Parser!$AB$1,Parser!$AB$4:$AB$303,Parser!$AK$1:$AN$1,Parser!$AK$4:$AN$303"
I found that using the following function:"=Parser!$AB$1,OFFSET(Parser!$AB$1:Parser!$AB$1,Parser!$D$2,0,Parser!$B$2,1),Parser!$AK$1:$AN$1,OFFSET(Parser!$AK$1:Parser!$AO$1,Parser!$D$2,0,Parser!$B$2,4)"
I am able to update the data range to the one I want using a different cell as a reference. The problem with this is that the OFFSET function dissappears after entering it. It calculates the value and is done. So if I change the value in my reference cell the data range doesn't update itself.
To avoid this problem I wanted to use a macro that would allow me to click a button and it would update the data range. I would assume that I would use the SetSourceData Function but I don't know how to map the function that I currently have into VB so that it would do the same thing. Any ideas?
I found that using the following function:"=Parser!$AB$1,OFFSET(Parser!$AB$1:Parser!$AB$1,Parser!$D$2,0,Parser!$B$2,1),Parser!$AK$1:$AN$1,OFFSET(Parser!$AK$1:Parser!$AO$1,Parser!$D$2,0,Parser!$B$2,4)"
I am able to update the data range to the one I want using a different cell as a reference. The problem with this is that the OFFSET function dissappears after entering it. It calculates the value and is done. So if I change the value in my reference cell the data range doesn't update itself.
To avoid this problem I wanted to use a macro that would allow me to click a button and it would update the data range. I would assume that I would use the SetSourceData Function but I don't know how to map the function that I currently have into VB so that it would do the same thing. Any ideas?