View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron[_6_] Ron[_6_] is offline
external usenet poster
 
Posts: 48
Default If Selection < 0 then msgbox

On Apr 27, 12:08*pm, Simon Lloyd
wrote:
Your just missing how to use a worksheet function in VBA:

Range(Selection, Selection.End(xlDown)).Offset(0,
11).Select
With Selection
If Application.WorksheetFunction.Sum(Selection) < 0 Then
MsgBox "Out of Balance"
End If
End With

Ron;324186 Wrote:

Hello all,
I'm trying to validate that the total of the selected cell is < 0
but, I'm getting an error with the code below..


Range(Selection, Selection.End(xlDown)).Offset(0, 11).Select
With Selection
If Sum.Selection < 0 Then
MsgBox "Out of Balance"


End If
End With


Assistance greatly appreciated, Ron


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile:http://www.thecodecage.com/forumz/member.php?userid=1
View this thread:http://www.thecodecage.com/forumz/sh...ad.php?t=90593


Hi Simon,
Thanks, this will come in handy in other projects. Thank you, Ron