Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello people, I'm new to VBA writing... and am trying to do a simple function, bu it's proving rather complex. I'm wanting the macro to count the numbe of "C" in the column A, and out put the value in a message box. Below is what I have got so far, I dont get any error messages and th msgbox pops up, but there are no values in the box.. I hope some one can give me some help. Thank you! Simon Sub CommandButton1_Click() Dim colA As Range Dim emplCount As Integer Set colA = ActiveSheet.Range("A:A") Dim total_Employees For Each cell In colA If cell = "C" = True Then emplCount = emplCount + 1 End If Next emplCount = total_Employees MsgBox total_Employees & "Number of employees" End su -- simon1081 ----------------------------------------------------------------------- simon10810's Profile: http://www.excelforum.com/member.php...fo&userid=3531 View this thread: http://www.excelforum.com/showthread.php?threadid=55092 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What am I doing wrong | Excel Discussion (Misc queries) | |||
Insert Calculated Field (wrong Qty*Price = wrong Amount) | Excel Discussion (Misc queries) | |||
what do I do wrong? | Excel Programming | |||
Where am I going wrong? | Excel Discussion (Misc queries) | |||
What's Wrong? | Excel Programming |