Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Negative Numbers count

I am looking for code that would count all the negative numbers in a column
and msgbox the results.

Thanks,
Aaron
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Negative Numbers count

Msgbox Application.COUNTIF(Range(A:A),"<0")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Aaron" wrote in message
...
I am looking for code that would count all the negative numbers in a

column
and msgbox the results.

Thanks,
Aaron



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Negative Numbers count

What if I wanted to count two different tabs and report both results in one
msgbox?

"Bob Phillips" wrote:

Msgbox Application.COUNTIF(Range(A:A),"<0")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Aaron" wrote in message
...
I am looking for code that would count all the negative numbers in a

column
and msgbox the results.

Thanks,
Aaron




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Negative Numbers count

Something like this...

MsgBox Application.CountIf(Sheets("Sheet1").Range("A:A"), "<0") + _
Application.CountIf(Sheets("Sheet2").Range("B:B"), "<0")

or this...

MsgBox Application.CountIf(Sheets("Sheet1").Range("A:A"), "<0") & vbcrlf
& _
Application.CountIf(Sheets("Sheet2").Range("B:B"), "<0")

--
HTH...

Jim Thomlinson


"Aaron" wrote:

What if I wanted to count two different tabs and report both results in one
msgbox?

"Bob Phillips" wrote:

Msgbox Application.COUNTIF(Range(A:A),"<0")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Aaron" wrote in message
...
I am looking for code that would count all the negative numbers in a

column
and msgbox the results.

Thanks,
Aaron




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel, change column of negative numbers to positive numbers? Nita New Users to Excel 3 November 27th 07 04:54 AM
Excel 2002 : Convert Positive Numbers to Negative Numbers ? Mr. Low Excel Discussion (Misc queries) 2 November 6th 06 03:30 PM
How do I count how many positive and negative numbers in a couumn Art Nittskoff Excel Discussion (Misc queries) 3 October 19th 06 10:22 PM
Set negative numbers to zero. Do not calculate with negative valu Excel Headache Excel Discussion (Misc queries) 4 September 14th 06 08:56 PM
Need to reconcile numbers accounting Harlan Grove code doesn't work for negative numbers [email protected] Excel Programming 1 July 28th 06 07:09 AM


All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"