Text & General Format to Data Format all the data - code/VBA required

Vishaal

Well-known Member
Joined
Mar 16, 2019
Messages
533
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
  2. Web
Hi all,

we have the following data and want to convert in "date", we have tried
Code 1 =TEXT(A1,"mm\/dd\/yyyy")+0
Code 2 =TEXT(G12,"mm/dd/yyyy")

but problem not solved, pls check the result after using the above code and provide the code/vba, also when we copy the data after using code 1, we cant get the value as data

Data

Excel 2010 32 bit
A
B
C
1
its my format which I want to change in date format
2
Date
3
01-04-2019​
=TEXT(A3,"mm\/dd\/yyyy")+0​
=TEXT(A3,"mm/dd/yyyy")​
4
02-04-2019​
=TEXT(A4,"mm\/dd\/yyyy")+0​
=TEXT(A4,"mm/dd/yyyy")​
5
02-04-2019​
=TEXT(A5,"mm\/dd\/yyyy")+0​
=TEXT(A5,"mm/dd/yyyy")​
6
04-04-2019​
=TEXT(A6,"mm\/dd\/yyyy")+0​
=TEXT(A6,"mm/dd/yyyy")​
7
05-04-2019​
=TEXT(A7,"mm\/dd\/yyyy")+0​
=TEXT(A7,"mm/dd/yyyy")​
8
06-04-2019​
=TEXT(A8,"mm\/dd\/yyyy")+0​
=TEXT(A8,"mm/dd/yyyy")​
9
24-09-2019​
=TEXT(A9,"mm\/dd\/yyyy")+0​
=TEXT(A9,"mm/dd/yyyy")​
10
4/5/2019​
=TEXT(A10,"mm\/dd\/yyyy")+0​
=TEXT(A10,"mm/dd/yyyy")​
11
4/9/2019​
=TEXT(A11,"mm\/dd\/yyyy")+0​
=TEXT(A11,"mm/dd/yyyy")​
12
4/17/2019​
=TEXT(A12,"mm\/dd\/yyyy")+0​
=TEXT(A12,"mm/dd/yyyy")​
13
4/26/2019​
=TEXT(A13,"mm\/dd\/yyyy")+0​
=TEXT(A13,"mm/dd/yyyy")​
14
5/4/2019​
=TEXT(A14,"mm\/dd\/yyyy")+0​
=TEXT(A14,"mm/dd/yyyy")​
15
5/4/2019​
=TEXT(A15,"mm\/dd\/yyyy")+0​
=TEXT(A15,"mm/dd/yyyy")​
16
5/21/2019​
=TEXT(A16,"mm\/dd\/yyyy")+0​
=TEXT(A16,"mm/dd/yyyy")​
17
20-07-2019​
=TEXT(A17,"mm\/dd\/yyyy")+0​
=TEXT(A17,"mm/dd/yyyy")​
18
06/08/19​
=TEXT(A18,"mm\/dd\/yyyy")+0​
=TEXT(A18,"mm/dd/yyyy")​
19
24-07-2019​
=TEXT(A19,"mm\/dd\/yyyy")+0​
=TEXT(A19,"mm/dd/yyyy")​
20
26/09/2019​
=TEXT(A20,"mm\/dd\/yyyy")+0​
=TEXT(A20,"mm/dd/yyyy")​
Sheet: Sheet1


Result Data
Excel 2010 32 bit
A
B
C
1
its my format which I want to change in date format
2
Date
3
01-04-2019​
01-04-2019​
04/01/2019​
4
02-04-2019​
02-04-2019​
04/02/2019​
5
02-04-2019​
02-04-2019​
04/02/2019​
6
04-04-2019​
04-04-2019​
04/04/2019​
7
05-04-2019​
05-04-2019​
04/05/2019​
8
06-04-2019​
06-04-2019​
04/06/2019​
9
24-09-2019​
24-09-2019​
09/24/2019​
10
4/5/2019​
05-04-2019​
04/05/2019​
11
4/9/2019​
09-04-2019​
04/09/2019​
12
4/17/2019​
17-04-2019​
04/17/2019​
13
4/26/2019​
26-04-2019​
04/26/2019​
14
5/4/2019​
04-05-2019​
05/04/2019​
15
5/4/2019​
04-05-2019​
05/04/2019​
16
5/21/2019​
21-05-2019​
05/21/2019​
17
20-07-2019​
#VALUE!​
20-07-2019​
18
06/08/19​
08-06-2019​
06/08/2019​
19
24-07-2019​
#VALUE!​
24-07-2019​
20
26/09/2019​
26-09-2019​
09/26/2019​
Sheet: Sheet1
 
Last edited:
1. DD-MM-YYYY
2. DD/MM/YYYY
3. Some cells are General
This is not like the data you posted.
For example :
24-9-2019 (is it DD-M-YYYY or D-M-YYYY?)
4/5/2019 (is it D/M/YYYY or M/D/YYYY?)
4/17/2019 (is it M/DD/YYYY or M/D/YYYY?)
Are these examples text or dates?
 
Last edited:
Upvote 0

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.
Maybe this : =IF(ISNUMBER(A3),A3,DATEVALUE(A3))
 
Upvote 0
Thanks footoo,

thanks for giving time and help
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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