ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting recurring cells (https://www.excelbanter.com/excel-programming/380105-counting-recurring-cells.html)

Peter[_61_]

Counting recurring cells
 
The problem is thus:
I am trying to count the volume of cells on a sheet with the value
"total", but I don't know how to!

Does anyone in googleland have any ideas?

Thanks for your help,

Peter


Don Guillett

Counting recurring cells
 

Have a look in the help index for COUNTIF
--
Don Guillett
SalesAid Software

"Peter" wrote in message
ups.com...
The problem is thus:
I am trying to count the volume of cells on a sheet with the value
"total", but I don't know how to!

Does anyone in googleland have any ideas?

Thanks for your help,

Peter




Dave Peterson

Counting recurring cells
 
=countif(a1:a100,"total")
or
=countif(a1:a100,"*total*")

Adjust your range to match what you need.

Peter wrote:

The problem is thus:
I am trying to count the volume of cells on a sheet with the value
"total", but I don't know how to!

Does anyone in googleland have any ideas?

Thanks for your help,

Peter


--

Dave Peterson

Peter[_61_]

Counting recurring cells
 
Thanks for the reply but countif does not seem to work in VBA. Sorry
for not being clear in my question but I am writing a macro in VBA. If
you can do it in Excel I'm sure you can do it in VBA.

Thanks,

Peter


Don Guillett

Counting recurring cells
 

application.countif(range("
--
Don Guillett
SalesAid Software

"Peter" wrote in message
ups.com...
Thanks for the reply but countif does not seem to work in VBA. Sorry
for not being clear in my question but I am writing a macro in VBA. If
you can do it in Excel I'm sure you can do it in VBA.

Thanks,

Peter




Don Guillett

Counting recurring cells
 
or
for each c in range("a2:a22")
if ucase(c)="TOTAL" then mc=mc+1
next
msgbox mc

--
Don Guillett
SalesAid Software

"Peter" wrote in message
ups.com...
Thanks for the reply but countif does not seem to work in VBA. Sorry
for not being clear in my question but I am writing a macro in VBA. If
you can do it in Excel I'm sure you can do it in VBA.

Thanks,

Peter




Peter[_61_]

Counting recurring cells
 
Thanks,

This is what I did in the end:

Cells(1, 4) = "=COUNTIF(R[0]C[-1]:R[" & c & "]C[-1],""Total"")"
m = Cells(1, 4).Value
Cells(1, 4).Select
Selection.Clear
MsgBox m & " totals"


Peter



Don Guillett wrote:
or
for each c in range("a2:a22")
if ucase(c)="TOTAL" then mc=mc+1
next
msgbox mc

--
Don Guillett
SalesAid Software

"Peter" wrote in message
ups.com...
Thanks for the reply but countif does not seem to work in VBA. Sorry
for not being clear in my question but I am writing a macro in VBA. If
you can do it in Excel I'm sure you can do it in VBA.

Thanks,

Peter



Don Guillett

Counting recurring cells
 
If you like it?

--
Don Guillett
SalesAid Software

"Peter" wrote in message
ups.com...
Thanks,

This is what I did in the end:

Cells(1, 4) = "=COUNTIF(R[0]C[-1]:R[" & c & "]C[-1],""Total"")"
m = Cells(1, 4).Value
Cells(1, 4).Select
Selection.Clear
MsgBox m & " totals"


Peter



Don Guillett wrote:
or
for each c in range("a2:a22")
if ucase(c)="TOTAL" then mc=mc+1
next
msgbox mc

--
Don Guillett
SalesAid Software

"Peter" wrote in message
ups.com...
Thanks for the reply but countif does not seem to work in VBA. Sorry
for not being clear in my question but I am writing a macro in VBA. If
you can do it in Excel I'm sure you can do it in VBA.

Thanks,

Peter





Peter[_61_]

Counting recurring cells
 
To be honest I prefered your way, it was just while I was waiting I
worked out the above.

Thanks for the help,

Peter

On Dec 27, 5:34 pm, "Don Guillett" wrote:
If you like it?

--
Don Guillett
SalesAid Software
"Peter" wrote in oglegroups.com...



Thanks,


This is what I did in the end:


Cells(1, 4) = "=COUNTIF(R[0]C[-1]:R[" & c & "]C[-1],""Total"")"
m = Cells(1, 4).Value
Cells(1, 4).Select
Selection.Clear
MsgBox m & " totals"


Peter


Don Guillett wrote:
or
for each c in range("a2:a22")
if ucase(c)="TOTAL" then mc=mc+1
next
msgbox mc


--
Don Guillett
SalesAid Software

"Peter" wrote in message
roups.com...
Thanks for the reply but countif does not seem to work in VBA. Sorry
for not being clear in my question but I am writing a macro in VBA. If
you can do it in Excel I'm sure you can do it in VBA.


Thanks,


Peter- Hide quoted text -- Show quoted text -




All times are GMT +1. The time now is 02:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com