I am new to macro function. I have been trying to insert a pie chart on the Subject_name fields (X,Y,Z) in Excel via macro function. The user should be able to plot this graph when clicking a macro command button. Basically, it should count and then use the number to plot the chart.
Here is the example of current data:
Channel_Type | Channel_Category | Category | **Subject_Name**
MICROBLOG General A X
Forum General A Z
BLOG General A Y
FORUM General A X
MICROBLOG General A Z
BLOG General A Z
Here is the desired outcome:
X : 2 | Y : 1 | Z : 3
This is what i tried before to plot the graph for the whole sheet but i am unsure of how to just select one column:
Option Explicit
Sub Example()
Dim cht As ChartObjects
For Each cht In Worksheets(1).ChartObjects
Next cht
cht.Chart.ChartType = xlPie
End Sub
I have been stuck for awhile. Appreciate any help.

