Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif a Name occures in a column
Hi all,
I need to count the number of time a name appears in a column and then save the amount in a cell. I would like to do this with code as i manipulate the spreadsheet. I have done it with a countif formular in the cell, nut must one do this ? or is it better to store the total as a variable and then past the variable into the cell, it is the latter that i am not sure how to do. Thanks in advance Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif a Name occures in a column
Sub CountName ()
Dim numname as Long Dim namerng as Range Set namerng as Sheets("Sheet1").Range("A1:A100") 'where your list of names are located numname = Application.WorksheetFunction.Countif("Name", namerng) Sheets("Sheet1").Range("B1"). Value = numname 'puts answer on sheet End Sub Mike F "Tempy" wrote in message ... Hi all, I need to count the number of time a name appears in a column and then save the amount in a cell. I would like to do this with code as i manipulate the spreadsheet. I have done it with a countif formular in the cell, nut must one do this ? or is it better to store the total as a variable and then past the variable into the cell, it is the latter that i am not sure how to do. Thanks in advance Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif a Name occures in a column
Sub CountNames()
MyName = "Alan" Set Myrng = Range("A1:A10000") NameCount = Application.CountIf(Myrng, MyName) MsgBox NameCount Range("B1") = Application.CountIf(Myrng, MyName) ' or Range("B1")=NameCount End Sub "Tempy" wrote: Hi all, I need to count the number of time a name appears in a column and then save the amount in a cell. I would like to do this with code as i manipulate the spreadsheet. I have done it with a countif formular in the cell, nut must one do this ? or is it better to store the total as a variable and then past the variable into the cell, it is the latter that i am not sure how to do. Thanks in advance Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif a Name occures in a column
|
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif a Name occures in a column
Sub Foo()
cnum = Application.CountIf(Range("C:C"), "*" & Test & "*") Range("A1").Value = cnum End Sub "Tempy" wrote in message ... Hi all, I need to count the number of time a name appears in a column and then save the amount in a cell. I would like to do this with code as i manipulate the spreadsheet. I have done it with a countif formular in the cell, nut must one do this ? or is it better to store the total as a variable and then past the variable into the cell, it is the latter that i am not sure how to do. Thanks in advance Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif a Name occures in a column
Could you please give me some more advice on this topic.
I need to look for 19 different names and put the totals in a column. Is it possible to have a list of names, perhaps in my Personal.xls workbook, and with the code find the results for one name, paste it and then get the next name, until the end of the list ? Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif a Name occures in a column
Name your list of names and do a loop or just use a vlookup formula
for each name in [mylistofnames] code next -- Don Guillett SalesAid Software "Tempy" wrote in message ... Could you please give me some more advice on this topic. I need to look for 19 different names and put the totals in a column. Is it possible to have a list of names, perhaps in my Personal.xls workbook, and with the code find the results for one name, paste it and then get the next name, until the end of the list ? Tempy *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
COUNTIF: 2 criteria: Date Range Column & Text Column | Excel Worksheet Functions | |||
CountIf using every other column | Excel Discussion (Misc queries) | |||
countif column d equals x and column a noblank | Excel Worksheet Functions | |||
countif Column A and excule column B if it's cancelled | Excel Worksheet Functions | |||
How do I Excel countif column a =? and column b = null ? | Excel Worksheet Functions |