Checking date input

Michael Simpson

Board Regular
Joined
Jun 21, 2010
Messages
232
First of all, my apologies is this is a ridiculously newbie question. I have written applications in VBA, but am (on a scale of 1-10) a 1 when it comes to using the basic aspects of Excel.

My question is as follows. I have been given a small workbook (cols A-J, 20-30 lines - number of lines can vary/increase). This workbook is updated by end-users who then export it as a CSV file. It is then uploaded to a mainframe and used as input there. Trouble is, of course, then they end up entering all sorts of garbage in rows/columns that they shouldn't. I was asked if I could change the workbook so that their data was checked (as much as possible) at source before uploading.

To begin with, they want to ensure that a data column only has valid dates, but I suspect the day will come when they start wanting to check other columns, both as they are and with relational checks between columns.

I have no problems in designing a userform and locking the sheet so they can only enter/change data via the form but is this the best way to go ?

Thank you
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi Michael,

Yes, I believe forcing the uses to enter the data properly at the beginning is always best. If you don't do this there are myriad ways the users can enter things, often in ways that you can't predict or anticipate. Not only should you check whether the users enter dates that are valid as dates, but are in a valid range, and are valid days of the week, etc. Checking things like this can save you a lot of headaches later.

Doing such checks in Excel is relatively simple, including the relational checks between columns (this is the type of thing that Excel is designed for), so I wouldn't try to hard to avoid it.

Yes, you can do it by requiring all input via a userform, but you can also do it by checking the data in each data entry cell as soon as the user enters it, and not allowing the user to proceed without fixing it. This requires a bit of VBA code, but is not difficult. Alternately you could wait until the user tries to save the workbook, then highlight all the errors, and not allow the user to save it until all errors are corrected.

Keep Excelling.

Damon
 
Upvote 0
Thanks Damon. Like I say, I'm a real newbie when it comes to using Excel without using VBA code. I'll have a shot at your suggestion of using as little VBA code as possible and without using a form (you gotta learn sometime)
 
Upvote 0

Forum statistics

Threads
1,222,095
Messages
6,163,899
Members
451,865
Latest member
dunworthc

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top