Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Countif(RC4, < >) 1

Status
Not open for further replies.

WaterSprite

Technical User
Mar 23, 2004
69
US
Activecell.FormulaR1C1 = "=Countif(RC4, "">15,<31"")"

I get a zero when I run this on a number between 15 and 31.

Is there a way to use Countif with less than, greater than.

And I am clueless about how to use the TGML to identify my lines of code in my questions. I have the "process TGML" box checked in step 5, options, but nothing happens.
 
Code:
Activecell.FormulaR1C1 = "=Countif(RC4, "">15"") - Countif(RC4, "">31"")"
But you'll notice that using RC4 selects only a single cell. I assume that you're wanting to count numbers in the entire column. For that, just omit the "R"s so you're not referencing any particular Row.
Code:
Activecell.FormulaR1C1 = "=Countif(C4, "">15"") - Countif(C4, "">31"")"

[tt][blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Thank you for the code. I have a range of about 12 cells that record pump rates, tank levels, pressures, etc each hour of the day. I will just use ActiveCell.Offset and a loop to use one set of code to check each hours worth of readings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top