K
kiwicolin
Hi I have a sheet that I update using a form with the code below. The
problem I am having is that it seems to randomly change the date format
on the sheet from dd/mm/yyyy to mm/dd/yyyy. It seems to be totally
random. I have checked the cell formats and they seem to be all set to
dd/mm/yyyy. I have checked the system settings and they seem good too.
I can enter a couple of dates correctly then it will fail on me, if I
ignore it & continue it will suddenly do a few more dates as I wish and
then fail again. The dates on the form looks ok each time though.
Any suggestions out there.
I would really appreciatte any help.
Thanks.
Colin
Private Sub CommandButton8_Click()
If txtdate.Value = "" Then Exit Sub
If txttrain.Value = "" Then Exit Sub
ActiveSheet.Unprotect Password:="********"
Range("A14").Select
Do
If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txttrain.Value
ActiveCell.Offset(0, 1) = txtdate.Value
ActiveCell.Offset(0, 2) = txtresult.Value
ActiveCell.Offset(0, 3) = txtrefresh.Value
ActiveCell.Offset(0, 4) = txttrainer.Value
ActiveSheet.Protect Password:="********"
ActiveWorkbook.Save
Unload Me
frmdataentry.Show
End Sub
problem I am having is that it seems to randomly change the date format
on the sheet from dd/mm/yyyy to mm/dd/yyyy. It seems to be totally
random. I have checked the cell formats and they seem to be all set to
dd/mm/yyyy. I have checked the system settings and they seem good too.
I can enter a couple of dates correctly then it will fail on me, if I
ignore it & continue it will suddenly do a few more dates as I wish and
then fail again. The dates on the form looks ok each time though.
Any suggestions out there.
I would really appreciatte any help.
Thanks.
Colin
Private Sub CommandButton8_Click()
If txtdate.Value = "" Then Exit Sub
If txttrain.Value = "" Then Exit Sub
ActiveSheet.Unprotect Password:="********"
Range("A14").Select
Do
If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txttrain.Value
ActiveCell.Offset(0, 1) = txtdate.Value
ActiveCell.Offset(0, 2) = txtresult.Value
ActiveCell.Offset(0, 3) = txtrefresh.Value
ActiveCell.Offset(0, 4) = txttrainer.Value
ActiveSheet.Protect Password:="********"
ActiveWorkbook.Save
Unload Me
frmdataentry.Show
End Sub