+ Reply to Thread
Results 1 to 5 of 5

Click a button: Check sheet, display errors?

  1. #1
    Registered User
    Join Date
    08-29-2014
    Location
    Michigan
    MS-Off Ver
    10
    Posts
    7

    Click a button: Check sheet, display errors?

    Howdy all,

    Wondering if such a thing is possible: I've got a sheet that I use to enter a number of different things for orders. The user needs to make sure they enter some key data in some fields while other fields are purely optional. Additionally, some fields have to add up to other fields. The quantity entered in area A needs to equal the quantity entered in area B.

    Right now I have it that there are logic tests for each critical area. There's a hidden spot in my sheet where I've got if-statements basically setup so that: "If cell f18 is blank, then put a 1 here, otherwise but a 0 here." Or I have something like this: "If a+b+c = x+y+z, then put a 0 here, otherwise put a 1." In short, 1 = bad, 0 = good. Let's say these cells are x20, x21, x22, x23, x24, and x25.

    So, what I want to do it setup a button so that when the user click it a macro or vba checks cell x20. If that cell's value is 1 (ie, bad) then Excel displays a message saying: "You haven't entered customer name." Then it checks cell x21. IF that value is 1, then it display a message like: "Quantities do not match." Basically anytime it sees a 1 in any of those cells it should display a warning message and then stop the script.

    However, it all cells in the range it checks have a 0, then it should change a cell from one value (in progress) to another (complete). Is something like this possible?
    Last edited by rrbee; 12-16-2014 at 10:14 AM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Click a button: Check sheet, display errors?

    Hi rrbee,

    Something like this?

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    08-29-2014
    Location
    Michigan
    MS-Off Ver
    10
    Posts
    7

    Re: Click a button: Check sheet, display errors?

    That looks like it should work! The only issue is that I'm creating a new sheet for each invoice that I make, and it looks like I'd have to manually enter the new worksheet name in that thrid line of code. Is there a way to make it use whatever the current sheet is?

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Click a button: Check sheet, display errors?

    Instead of set ws = worksheets("name") use this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-29-2014
    Location
    Michigan
    MS-Off Ver
    10
    Posts
    7

    Re: Click a button: Check sheet, display errors?

    Thanks much! Works like a charm!

+ 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. Display 1 or 0 based on Checkbox selection - On Radio Button Click
    By gmalpani in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2014, 05:37 AM
  2. [SOLVED] Check Box click to display a specific value.
    By Zaid in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2013, 09:41 AM
  3. Command Button Click intiate Check box creation and tick it?
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2012, 08:13 AM
  4. [SOLVED] Check Criteria On Button Click Before Running Macro
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-06-2012, 04:56 PM
  5. Call button click event from a button on anther sheet
    By ajaykgarg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-25-2010, 09:27 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