+ Reply to Thread
Results 1 to 3 of 3

Check range equals 100%

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Check range equals 100%

    I'm putting a check into some code to make sure certain range, all the cells equal 100%

    My code is as follows;

    Please Login or Register  to view this content.
    When i run the code i get an error of type mismatch?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Check range equals 100%

    Hi,

    That's because you're asking for the Value of a Range. Individual cells have values, whole ranges don't have a single value.

    Incidentally the way I always handle these sorts of checks is to use a named helper cell in the workbook (name it 'Check' if you like) which uses the IF test and results in either "OK" or "Not OK"

    Then just test the helper cell in VBA. e.g.

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2407 Win 11 Home 64 Bit
    Posts
    24,084

    Re: Check range equals 100%

    I believe that you need a sum function to add the values in J3:J23

    Something along these lines

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If each cell in range equals 0 then clear contents of range and move to the next row
    By dagardner in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-19-2014, 08:44 PM
  2. Check if a filename contains (not equals) the value of a cell
    By kevv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2013, 10:27 AM
  3. Macro to check range, if false check another range until true, then copy
    By jayers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-12-2009, 04:19 PM
  4. Using condition format to check if day equals Friday
    By Zyphon in forum Excel General
    Replies: 4
    Last Post: 05-20-2007, 05:57 PM
  5. if a:a (range) equals january and c:c equals gas then add g:g ($)
    By BCOz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-29-2005, 03:45 PM

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