I'm new to using macros. I've been attempting to use an Excel macro tool to insert a pie chart on the Subject name fields (X, Y, and Z). When the user clicks a macro command button, this graph should be able to be drawn. In essence, it should count, and then produce the chart using the result.
Here is an 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