Date copy issue in excel

Closed
Naga - Jun 13, 2010 at 05:53 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jun 14, 2010 at 04:54 AM
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

Related:

2 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 13, 2010 at 06:13 PM
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
0
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
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 13, 2010 at 08:22 PM
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")
0
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
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 14, 2010 at 04:54 AM
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
0