Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Producing warnings

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    How do I produce a warning that tells the user of the database that no patients have been admitted?

    My spreadsheet contains 7 columns. Column E is the admitted column with the dates that the patients were admitted.

    How do I produce an If Statement so that when my macro runs if non of the patients have been admitted a warning will appear?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Not sure, but, do you check if any patients have been admited depending on today's date ? or yesterday ?

    Or do you want to look in Column E and see if there is anything there ?
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Frankie


    How about

    If WorksheetFunction.CountA(Columns(5) = 0) Then
    MsgBox "No Patients", vbCritical
    Exit Sub
    End If

  4. #4
    New Member
    Join Date
    Apr 2002
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    It's not working a mis match error appears. Am I doing something wrong? Is there something I will have to change?

  5. #5
    New Member
    Join Date
    Apr 2002
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Juan, yes it is column E I want to look at

  6. #6
    Board Regular
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    EDIT: Deleted posted answer to wrong question

    [ This Message was edited by: Cosmos75 on 2002-04-10 13:54 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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