Date update overflow error ‘6’

Tayl4n

Board Regular
Joined
Feb 17, 2021
Messages
68
Office Version
  1. 2016
Platform
  1. Windows
Dear MrExcel community,
I have a project search & update & add & delete can do.
There are 32 column and 5 of them is date.
When I search date format has changed automatically “dd.mm.yyyy” to “mm/dd/yyyy” and shows up to textbox with that wrong format.
I solved this with this code;

VBA Code:
txtU.Text = Format(txtU, “dd.mm.yyyy”
But this time update functions are broken for date textboxes. When I try to change a date on textbox this error shows up and date changin randomly ex. I press 2 and date changes to “01.01.1900”.
I feel confused. I use these codes for update;
VBA Code:
Sheets(“Worksheet”).Cells(y,1).Value = txtA
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Tayl4n

Board Regular
Joined
Feb 17, 2021
Messages
68
Office Version
  1. 2016
Platform
  1. Windows
VBA Code:
Sheets(“Worksheet”).Cells(y,1).Value = txtU
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,420
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Assuming the date string in your text box is in your regional format, use:

VBA Code:
Sheets("Worksheet").Cells(y,1).Value = CDate(txtU.Text)
 

Tayl4n

Board Regular
Joined
Feb 17, 2021
Messages
68
Office Version
  1. 2016
Platform
  1. Windows
Assuming the date string in your text box is in your regional format, use:
VBA Code:
Sheets("Worksheet").Cells(y,1).Value = CDate(txtU.Text)
I wrote these codes to initalize. When I search, date shows up as “mm/dd/yyyy”. I do not this format. Im trying to do “dd.mm.yyyy” and do this editable
 

Tayl4n

Board Regular
Joined
Feb 17, 2021
Messages
68
Office Version
  1. 2016
Platform
  1. Windows

ADVERTISEMENT

* I don’t want
Assuming the date string in your text box is in your regional format, use:

I wrote these codes to initalize. When I search, date shows up as “mm/dd/yyyy”. I do not want this format. Im trying to do “dd.mm.yyyy” and do this editable
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,420
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Date values are date values, formatting is a completely separate issue. You can simply set the NumberFormat of the cell to whatever you want.
 

Tayl4n

Board Regular
Joined
Feb 17, 2021
Messages
68
Office Version
  1. 2016
Platform
  1. Windows

ADVERTISEMENT

Date values are date values, formatting is a completely separate issue. You can simply set the NumberFormat of the cell to whatever you want.
Sir first of all thank you for your interest! But this part is the problem “
But this time update functions are broken for date textboxes. When I try to change a date on textbox this error shows up and date changin randomly ex. I press 2 and date changes to “01.01.1900”.
I feel confused. I use these codes for update;”. Dates comes to textbox as “dd.mm.yyyy” but ex. “13.02.2021” I want to change as “23.02.2021” and press only 2 on keyboard then date changin to “01.01.1900” every single number on keyboard changes date to illogical dates.
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
13,966
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
2 is the 2nd day starting from 1st January 1900 so typing 2 in a cell formatted as a date will result in 02.01.1900 (not 01.01.1900 btw) if your cells format is dd.mm.yyyy, so they are not "illogical dates".
 

Tayl4n

Board Regular
Joined
Feb 17, 2021
Messages
68
Office Version
  1. 2016
Platform
  1. Windows
2 is the 2nd day starting from 1st January 1900 so typing 2 in a cell formatted as a date will result in 02.01.1900 (not 01.01.1900 btw) if your cells format is dd.mm.yyyy, so they are not "illogical dates".
So how can I solve this problem?
 

Watch MrExcel Video

Forum statistics

Threads
1,127,065
Messages
5,622,475
Members
415,897
Latest member
Barry18180

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top