Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default best way to test a row for 0 values

That reports zero if none of the cells have zero, because the sum will still
be zero.

--
HTH

Bob Phillips

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

"Nigel" wrote in message
...
Sub zerocheck()
Dim testRange As Range, testRow As Long
testRow = 2
With ActiveSheet
Set testRange = ActiveSheet.Range(.Cells(testRow, "C"),

..Cells(testRow,
"K"))
End With

If Application.WorksheetFunction.Sum(testRange) = 0 Then
MsgBox "Zero!"
Else
MsgBox "Non-Zero"
End If

End Sub

--
Cheers
Nigel



"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
hit enter too fast. i was thinking of using application.sum. does this
make sense?

--


Gary


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
what's the best way to test a row, columns c through k to see if all

the
values are zeroes?

--


Gary









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 formula to test a value BETWEEN 2 values? Romi Excel Discussion (Misc queries) 8 July 29th 09 11:19 PM
Test if a value is in a range of values jfrick Excel Worksheet Functions 9 April 13th 08 09:02 PM
Return 1st, 2nd, 3rd largest test values John Excel Worksheet Functions 8 March 22nd 08 04:44 PM
Need to test for alphanumeric value and write numeric values to ce Pyramid 36 Excel Worksheet Functions 3 August 3rd 07 03:15 AM
Test if a number falls between 2 values dalymjl Excel Worksheet Functions 13 July 22nd 07 05:57 PM


All times are GMT +1. The time now is 11:50 AM.

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

About Us

"It's about Microsoft Excel"