![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 43
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
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 ? |
|
|
|
|
|
#3 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Frankie
How about If WorksheetFunction.CountA(Columns(5) = 0) Then MsgBox "No Patients", vbCritical Exit Sub End If |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Posts: 43
|
It's not working a mis match error appears. Am I doing something wrong? Is there something I will have to change?
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Apr 2002
Posts: 43
|
Juan, yes it is column E I want to look at
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
|
EDIT: Deleted posted answer to wrong question
[ This Message was edited by: Cosmos75 on 2002-04-10 13:54 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|