I'm new in VBA, And I need help in a problem regarding the date format when is transferred from textbox to the cells is changing from dd/mm/yyyy to mm/dd/yyyy.
This is the program that I create using a user form as interface in insert the data. My problem if I can not maintain the dd/mm/yyyy format when I transfer to the cells.
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("hocregister")
Set ws = Workbooks("Construction HOC register.xlsm").Worksheets("hocregister")
'revised code to avoid problems with Excel tables in newer versions
iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
'copy the data to the database
ws.Cells(iRow, 2).Value = Me.txthocdate.Value