-
Solved: Date from textbox to cell
I am using the follwing code to transfer date from textbox on a user form to a cell:
ActiveCell.Offset(0, 2).Value = Format(CDate(TextBox2.Value), "dd/mm/yyyy")
But the date is transferred as "mm/dd/yyyy" format.
My regional setting etc is in dd/mm/yyyy format. Also if I directly enter date in the cell, the date is saving well in dd/mm/yyyy format.
What to do now to fix this problem?
-
Since the cell is formatted the way that you want it, the cell needs to be filled with the underlying value rather than the formatted value.
[VBA]ActiveCell.Offset(0, 2).Value = CDate(TextBox2.Value)[/VBA]
-
Thanks its working great now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules