Results 1 to 7 of 7

MsgBox if a range of cells do not sum to 100%

Threaded View

  1. #1
    Registered User
    Join Date
    07-29-2010
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2007
    Posts
    35

    Lightbulb MsgBox if a range of cells do not sum to 100%

    I have a range of cells that should sum to 100%. If they do not, I want a MsgBox to appear saying that the user needs to adjust the cells until they are 100%. (And if the sum is 100%, no MsgBox appears)

    This code is not working - do I need to define the target, or revise/add lines? please help, thank you, and have a great holiday.

    Private Sub Worksheet_Change(ByVal Target As Range)
        
            If Sum(Range("I17:I46")) = "1" Then Exit Sub
            If Sum(Range("I17:I46")) <> "1" Then
                MsgBox "Adjust cells To sum to 100%"
            End If
    End Sub
    Last edited by kchen; 12-28-2010 at 02:44 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1