Date copy issue in excel [Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I need to copy dates from a webpage, it is displayed as JUN 12,2010 00:31:26 and I need the same date in excel as 12/05/2010 00:31

I'm using msoffice 2003

Please help

2 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
761
Is data in excel ? Could you post a sample book with macro that pulls data from web onto excel
Could you please upload a sample file with sample data etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc and post back here the link
I'm doing it manually, No scripts or macro.. I just wanna copy the date from a webpage...the date format in webpage is JUN 12,2010 00:31:26
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
761
Use this Custom function

Function convertToDate(inString As Variant) As Variant 
     
    If (inString = "") Then 
        convertToDate = "" 
    ElseIf Not IsDate(inString) Then 
        convertToDate = inString 
    Else 
        convertToDate = CDate(inString) 
    End If 
     
End Function 



To call the function you would say
=convertToDate(a1)
or
=convertToDate("JUN 12,2010 00:31:26")
Hi rizvisa1

Its a great idea...Working well.. However i need you to still more fine tune.

I cannot use "=convertToDate(a1)" as I cannot have both the dates in the worksheet.

For ex: JUN 12,2010 14:53:13 date should be present in the worksheet to covert it to 12/06/2010 14:53

neither

I cannot use "=convertToDate("JUN 12,2010 00:31:26")" as I copy and paste from webpage.
not easy to insert for every entry.

Thanks in advance
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
761
This is what you do
Insert a new column next to the column that has date
enter the formula in the first cell of the newly added column
select the newly entered column and choose copy
then pastespecial as values
delete the original column

i neglected to mention that you would have to format this newly added column as date in the manner of your choice

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!