+ Reply to Thread
Results 1 to 6 of 6

Message Box based on cell value containing formula

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Message Box based on cell value containing formula

    Hi Friends,

    I have a formula in cell B65 (=COUNTIF(B45:B64,TRUE)). If the total sum in cell B65 is more then 2, then a message box has to appear. Given below is my code and it does not work in cell B65 as it contain formula. But when I remove formula and manually type(in cell B65) 2,3,4 .... the message box appear. Let me know if I am doing something wrong.

    Please Login or Register  to view this content.
    Thanks,
    Rahul

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Message Box based on cell value containing formula

    Hi, the problem is that you are testing a fromula, so that means that you don't want people to enter something there.
    You not mention what the formula is and what is being added and which range the user fills data that is added up here.
    I have attached you macro modified to check any entry in column B above B65 and assuming that B65 is the sum of values in column B

    So if the sum exceeds 2 the message box appears

    Please Login or Register  to view this content.
    Good luck Rahul
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Message Box based on cell value containing formula

    Hi Keebellah,
    Thanks for your quick reply. The code you suggested is not working.

    The formula I have in Cell B65 is (=COUNTIF(B45:B64,TRUE)). It count the number of 'TRUE' from range B45:B64 and if the total count of 'TRUE' is more then 2 (in cell B65) then the message box need to display message "You exceeded 2".

    Hope I am clear now.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Message Box based on cell value containing formula

    If you read the code you can change it yourself!!!

    Please Login or Register  to view this content.
    I just gave you some code YOU did NOT tell me what range, but I expected you would discover that. the red text is the area you mention

    This is only triggered if the user enters TRUE or FALSE in that range, if that is a formula too, then you will have to give more information or even a sample file, guessing and assuming is not the best option to help you
    Last edited by Keebellah; 04-04-2018 at 04:46 PM. Reason: extra info

  5. #5
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Message Box based on cell value containing formula

    Hi Keeballah, I did change the range in you previous reply and tested it . But even after changing the range, the code is not showing the message box:

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Message Box based on cell value containing formula

    That means that nothing changes in the range("B45:B64")
    If these are formula's too, then it won't work you will just have to do it with a change for the entire sheet and test in the value in B65 >2 that's all

    Please Login or Register  to view this content.

+ 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. Run a message box / macros based on cell value.
    By npsnps in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-10-2017, 11:25 AM
  2. [SOLVED] auto Populate message on cell B based on input on cell A
    By dineshsachidananda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2014, 03:26 PM
  3. [SOLVED] how to pop up a message based on a cell value??
    By paul in forum Excel General
    Replies: 6
    Last Post: 02-27-2014, 03:41 AM
  4. [SOLVED] VBA- How to have message box appear based on cell info
    By Catniption in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2013, 03:38 PM
  5. Console Message or other notification based on cell value
    By BrettW in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-23-2009, 05:15 PM
  6. Message box based on user entry in cell
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2008, 04:41 PM
  7. How to display a pop message based on a cell value
    By ashvik in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 11:05 AM

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