A
A
arepository2019-03-05 00:48:21
Visual Basic
arepository, 2019-03-05 00:48:21

Why Day / Month are interchanged? How to make it not change?

When transferring the date from the table to the TextBox form field, the Day / Month are reversed.
For example, in cell A (1,1) = 03/04/2019, when the form is activated, the code simply states that this value is equal to the form field (TextBox1.Value = Sheets(1).Cells (1,1)) and the result is 3/4/2019.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Bcoon, 2019-03-05
@arepository

Everything is working correctly. Just the date in the text box is displayed in American format (MM-DD-YYYY).
Add the necessary formatting and everything will be as you want:
TextBox1.Value = Format(Sheets(1).Cells(1,1), "dd.mm.yyyy")

M
Mikhail Lyalin, 2019-03-05
@mr_jok

different national date and time formats

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question