+ Reply to Thread
Results 1 to 4 of 4

VBA IF error check that changes colour and displays message

  1. #1
    Forum Contributor
    Join Date
    06-18-2015
    Location
    Milton Keynes
    MS-Off Ver
    2016
    Posts
    101

    VBA IF error check that changes colour and displays message

    Hi Guys.

    I have the below code


    This relates to 4 Yes/No boxes.

    If the first (H26) is yes then I26 returns a 1

    If this is marked yes then the next 3 have to be marked yes or no (They can be left blank if H26 is no).

    So the I column returns 0 if its blank and 1 if it has text. I30 sums the 3 columns, which would add up to 3 or less.

    If this returns less then 3, I want the Field names to be marked red and a pop up message at the end ( I'd just put mes1, but I'll concatenate all error messages as I have 2-3 fields to check.)

    This however is doing absolutely nothing.

    Can someone tell me where I've gone wrong?



    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA IF error check that changes colour and displays message

    The syntax to read the values from cells I26 and I30 was incorrect.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    06-18-2015
    Location
    Milton Keynes
    MS-Off Ver
    2016
    Posts
    101

    Re: VBA IF error check that changes colour and displays message

    Thanks Alpha,

    What a stupid rookie mistake lol. I knew to do range.value but for some reason I didn't!!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA IF error check that changes colour and displays message

    You're welcome. Thanks for the feedback.

+ 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] How to check adjacent cell for value and display error message for certain conditions
    By ScotyB in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-01-2017, 08:17 PM
  2. Creating an Error Message that Displays a MsgBox
    By alacey425 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2016, 11:04 PM
  3. [SOLVED] If value is not in range: error message, then check if duplicates
    By vonrainer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-29-2014, 08:41 AM
  4. [SOLVED] Code displays error message reading "type mismatch"
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-12-2014, 09:32 AM
  5. Replies: 1
    Last Post: 12-14-2012, 10:11 AM
  6. Replies: 2
    Last Post: 12-18-2009, 05:20 PM
  7. Entering Correct Username Displays Colour
    By lvlister2005 in forum Excel General
    Replies: 10
    Last Post: 04-11-2007, 07:32 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