Date update overflow error ‘6’

Tayl4n

Board Regular
Joined
Feb 17, 2021
Messages
84
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
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
VBA Code:
Sheets(“Worksheet”).Cells(y,1).Value = txtU
 
Upvote 0
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)
 
Upvote 0
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
 
Upvote 0
* 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
 
Upvote 0
Date values are date values, formatting is a completely separate issue. You can simply set the NumberFormat of the cell to whatever you want.
 
Upvote 0
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.
 
Upvote 0
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".
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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
Back
Top