I have a problem with a VBA form.
the code in question gets a date from a cell in the worksheet and displays it in a text box input. (theadate)
it displays dd/mm/yyyy
The user has the option to change it via a tickbox (thedate)
then they change it and then when they press the command button the code saves the new date in the cell.
it saves mm/dd/yyyy
its confusing the dates because of the inane americans!
the code looks like:
thanks for any help
regards
the code in question gets a date from a cell in the worksheet and displays it in a text box input. (theadate)
it displays dd/mm/yyyy
The user has the option to change it via a tickbox (thedate)
then they change it and then when they press the command button the code saves the new date in the cell.
it saves mm/dd/yyyy
its confusing the dates because of the inane americans!
the code looks like:
Code:
Private Sub UserForm_Initialize()
Dim shtActive As Worksheet
Set shtActive = Application.Workbooks("system.xls").Worksheets("stats")
theadate = shtActive.Range("d2").Value
End Sub
Private Sub complete_Click()
Dim shtActive As Worksheet
Set shtActive = Application.Workbooks("system.xls").Worksheets("stats")
If thedate = False Then
shtActive.Range("d2").Value = theadate.Value
Else
shtActive.Range("d2").Formula = "=TODAY()"
End If
Unload fsettings
End Sub
thanks for any help
regards