mohamed gani
New Member
- Joined
- Jul 17, 2013
- Messages
- 7
Hi all,
I wanna change the source of pie chart by using vba, i tried this code but it select the colum C also. I just want to select a range (column B & Column D) only. below is a vba code,
Here is a table, I just want to ignore the column C, while select source data.
[TABLE="width: 241"]
<tbody>[TR]
[TD]
[TABLE="width: 197"]
<tbody>[TR]
[TD]Column B
[/TD]
[TD]Column C
[/TD]
[TD]Column D
[/TD]
[/TR]
[TR]
[TD]Group
[/TD]
[TD]amount
[/TD]
[TD]% Total
[/TD]
[/TR]
[TR]
[TD]abc
[/TD]
[TD]100
[/TD]
[TD]54.0 %
[/TD]
[/TR]
[TR]
[TD]def
[/TD]
[TD]200
[/TD]
[TD]62.0 %
[/TD]
[/TR]
[TR]
[TD]ghi
[/TD]
[TD]300
[/TD]
[TD]14.0 %
[/TD]
[/TR]
[TR]
[TD]jkl
[/TD]
[TD]500
[/TD]
[TD]21.0 %
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance,
by ,
Gani
I wanna change the source of pie chart by using vba, i tried this code but it select the colum C also. I just want to select a range (column B & Column D) only. below is a vba code,
Code:
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:=Sheets("Sheet2").Range("b7:b10", "d6:d10")
Here is a table, I just want to ignore the column C, while select source data.
[TABLE="width: 241"]
<tbody>[TR]
[TD]
[TABLE="width: 197"]
<tbody>[TR]
[TD]Column B
[/TD]
[TD]Column C
[/TD]
[TD]Column D
[/TD]
[/TR]
[TR]
[TD]Group
[/TD]
[TD]amount
[/TD]
[TD]% Total
[/TD]
[/TR]
[TR]
[TD]abc
[/TD]
[TD]100
[/TD]
[TD]54.0 %
[/TD]
[/TR]
[TR]
[TD]def
[/TD]
[TD]200
[/TD]
[TD]62.0 %
[/TD]
[/TR]
[TR]
[TD]ghi
[/TD]
[TD]300
[/TD]
[TD]14.0 %
[/TD]
[/TR]
[TR]
[TD]jkl
[/TD]
[TD]500
[/TD]
[TD]21.0 %
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance,
by ,
Gani