Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a range that i have set as myrng
this range is A1:a100, in this range i have either a "n" or a "y" in each cell, how can i use code to count all the y's within this range john |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello John,
you can make a for each loop und test if the value is y or n. For each vItem in myrng if vItem = "y" then count = count +1 next vItem |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
is there a way of doing it without looping i have seen a previous post
which used count=countwords(myrng,"y"), but this does not seem to work regards John |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
count = Application.COUNTIF(myrange,"y")
-- HTH Bob Phillips (remove nothere from email address if mailing direct) wrote in message oups.com... is there a way of doing it without looping i have seen a previous post which used count=countwords(myrng,"y"), but this does not seem to work regards John |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or
Sub countem() x = Application.CountIf(Range("a1:a100"), "y") MsgBox x End Sub -- Don Guillett SalesAid Software wrote in message oups.com... I have a range that i have set as myrng this range is A1:a100, in this range i have either a "n" or a "y" in each cell, how can i use code to count all the y's within this range john |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks that great!!!
John |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
glad to help
-- Don Guillett SalesAid Software wrote in message oups.com... thanks that great!!! John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count Vaules in a range that appear in another range | Excel Worksheet Functions | |||
COUNT BETWEEN A RANGE AND | Excel Discussion (Misc queries) | |||
Multiple Criteria, Count If, Sum Product to get count across range | Excel Worksheet Functions | |||
How to count dates within a certain range in a column with mutiple date range entries | Excel Worksheet Functions | |||
Count cells in one range based on parameters in another range | Excel Worksheet Functions |