View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_1112_] Simon Lloyd[_1112_] is offline
external usenet poster
 
Posts: 1
Default If Selection < 0 then msgbox


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