![]() |
check input in cells
Hi expert,
I have an application that runs in a userform. The user can click a button and then returns to Excel where he can put in up to 1000 records of data (employees of a copany with their data, date of birth, salary etc.) How can i make sure that the user fills out all the nescessary cells ? If the user puts in a line i need to check if the cells in column B,C,E,F and G are filled in. if one of the cells is not filled in, the application gives an error message and is closed without saving. I would rather have the program givean error message stating that the data that is filled in the cells is not complete. Is there a way to check this ? Thanks, Pierre -- Message posted via http://www.officekb.com |
check input in cells
Let's say you are dealing with row i. Try something link:
If IsEmpty(Cells(i, 2)) Or IsEmpty(Cells(i, 3)) Or IsEmpty(Cells(i, 5)) Or IsEmpty(Cells(i, 6)) Or IsEmpty(Cells(i, 7)) Then MsgBox ("Please complete input") End If End Sub Where the if is all in one line. -- Gary''s Student "Pierre via OfficeKB.com" wrote: Hi expert, I have an application that runs in a userform. The user can click a button and then returns to Excel where he can put in up to 1000 records of data (employees of a copany with their data, date of birth, salary etc.) How can i make sure that the user fills out all the nescessary cells ? If the user puts in a line i need to check if the cells in column B,C,E,F and G are filled in. if one of the cells is not filled in, the application gives an error message and is closed without saving. I would rather have the program givean error message stating that the data that is filled in the cells is not complete. Is there a way to check this ? Thanks, Pierre -- Message posted via http://www.officekb.com |
All times are GMT +1. The time now is 05:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com