Convert Dates To Text Format Using A Macro

May 16, 2007

Is there a way I can convert dates to text in a CSV file (opened via excel) using a macro?

Currently I have excel recognised dates in the first column of the format dd-mm-yyyy and a corresponding values in the second columns.

I know once I have the file open I can enter the following formula in an adjacent coloum "=text (A2, "MMM-YYYY") but I need to change the format in the existing date feild and not create a new coloum. Sure I could copy and paste the new formatted dates into the cell, but in terms of what I need to do, this is not practical as I several of these CSV files that I need to query and extract data from daily using a macro.

The macro is not currently working because the date format is wrong. I need it to appear as MMM - YYYY. When you view the date in excel it must appear like this (as it would appear in say microsoft word) and not with the underlying date format.

View 9 Replies


ADVERTISEMENT

Macro To Convert Dates To Correct Format

Jun 7, 2013

When I import data , the dates appear as follows in Col G sheets "Imported Data"

If I select Col G and use Text to columns and select mdy, it gives me the dates in the correct format. However, If I use the macro recorder to do this and then run the macro, it does not work

I have attached the dates after using text to Columns wjhich is the correct format.

Imported Assets *G207/01/2006302/01/2007402/01/2007511/01/2008601/01/1985720/11/1990801/01/1985901/01/19851001/01/19851101/01/19851225/09/19921302/01/1993

Imported Assets  G201/07/2006301/02/2007401/02/2007501/11/2008601/01/1985720/11/1990801/01/1985901/01/19851001/01/19851101/01/19851225/09/19921301/02/19931401/05/19931501/06/19931601/08/19931701/01/19941801/09/1995

View 2 Replies View Related

Macro To Convert Text 'dates'

Jul 21, 2008

I am trying to convert text 'dates' like Sat. 1/05/2007 to real dates. I need to find all 'date' cells in range B4:B100 (they are filled in yellow), strip off the offending text (i.e. Sat.), and use DateValue to turn the rest into a proper, numerical date in the ddd mm/dd/yy format, arial, bold, 10pt, and centered in place.

I've spent days trying to write this macro. I've had help from experts in forums, but whenever I need to make any slight modification, a trainwreck ensues. Please see the code below.

View 10 Replies View Related

Macro To Convert Dates Format From Yyyy Mm Dd To Yyyy-mm-dd

Feb 25, 2009

I have a 20,000 line Excel sheet...

And all the dates are entered like this:
2009 02 08

I want to add a dash, so they look like this
2009-02-08

so I added a command button, and this code, but its not searching the sheet and adding the dash's...

View 14 Replies View Related

Convert Dates To Another Format

Feb 15, 2010

I have attached a sample of the raw output of some call records from our telephone switch. My problem with the date data is twofold; first of all it outputs it in mm/dd/yyyy format, or so it appears. But when I try to change the format to mmm/ddd/yy Excel always interprets the 2nd pair of digits as the month instead of the first two. For example,the following 2 calls are from Jan 1st and Jan 2nd respectively;

01/01/2010
01/02/2010

but excel always treats the 2nd record as Feb 1st. I have read numerous posts from people with similar problems but I can't get any of their solutions to work with my data.

The second problem is that on the 13 of each month the phone switch suddenly stops putting a leading zero in front of the date making the data totally unreadable to Excel apparently. Again, I read a post of a similar problem but can't get their solution to work. My ultimate goal is to reformat the date data so that it is displayed as; ddd mm/dd and leave out the year entirely. Ex. Fri 02/12 as in today...Friday, Feb 12th. I really don't know if the problem is with the data or me at this point.

View 2 Replies View Related

Excel 2007 :: Unable To Convert Text Dates To System Dates

Oct 21, 2011

I am in strange situation where I have a data with Invoice Dates. These dates are in Text. However, when I convert it into reall excel dates. For some reason the dates do not come right. convert my text dates into excel real dates. I did a lot of google search and apply these three methods but all of these gave me strange result I was not expecting. These are the methods I used and the result of each method.

Method 1 : Using Text to Column Wizard (Excel 2007)

I highlighted invoice column and went into text to column wizard. I clikced on Date button, and selected MDY format. Strangely enough, my result was day, month and year i.e. DMY which does not seem right.

Then I press Control ~ on this data as shown in second view.

Inv DateMDY09/22/1122/09/201108/31/1131/08/201108/31/1131/08/201108/31/1131/08/201108/31/1131/08/2011

control ~ (overview)

Inv DateMDY09/22/114080808/31/114078608/31/114078608/31/114078608/31/1140786

2nd Method - Using formula to convert text date to real dates When I used formula, I get the following result. As you can see, formula is converting text dates into different system dates than the first method.Further strange things is when I take these system dates i.e. 4283 and in 2007 excel format use "Short Date" the same system date gets converted into wrong year as shown in the second view.

Inv DateFormulaFormula Result09/22/11=DATE(MID(B2,7,2),MID(B2,1,2),MID(B2,4,2))428308/31/11=DATE(MID(B3,7,2),MID(B3,1,2),MID(B3,4,2))426108/31/11=DATE(MID(B4,7,2),MID(B4,1,2),MID(B4,4,2))426108/31/11=DATE(MID(B5,7,2),MID(B5,1,2),MID(B5,4,2))426108/31/11=DATE(MID(B6,7,2),MID(B6,1,2),MID(B6,4,2))426108/31/11=DATE(MID(B7,7,2),MID(B7,1,2),MID(B7,4,2))4261

2nd view - system dates are getting converted into 1911

Inv DateFormulaFormula Result09/22/11428322/09/191108/31/11426131/08/191108/31/11426131/08/191108/31/11426131/08/191108/31/11426131/08/191108/31/11426131/08/1911

Similarly, I tried other methods or copying blanks etch but none seems to convert text dates into real (system dates).

View 4 Replies View Related

Convert Non-US Dates To US Date Format

Dec 9, 2006

I am parsing a string which contains (European) dates:

"10/08/2005,11/08/2005,12/08/2005,13/08/2005,14/08/2005,".

When broken into individual cells, dates before the 13th of the month are recognised as "American" dates and display as "08/10/2005", "08/11/2005", 08/12/2005" etc. with automatic date format. Dates from the 13th onwards are left in general format as "13/08/2005", "14/08/2005".

I have written a macro that converts each date individually to its correct Excel serial number, but I can't help thinking that there must be a simpler way, and that I cannot be the first to have asked this!

View 8 Replies View Related

Convert Imported Text Dates To True Dates

May 18, 2007

I have a very large spreadsheet that comes out of SAP and it brings out the majority of cell entries as text ie putting a ' at the begining of any number. the problem that i have is with the cells that have a date in them ie '19/04/07. I have tried varioous methods to remove this and turn the cells into date format but to no avail.

Also i do not get the option to convert text to number

View 6 Replies View Related

Automatically Convert Dates To Xx07 Format

Jul 3, 2007

Is there a way to find cells that have a date in them that has a text digit with a 2 digit year to 'xx07' rather than having to click on the error and selecting it manually.

it's playing havoc when I'm pulling some data from another workbook so converting en masse would sort the problem out!

Anyone know how to do this?

View 9 Replies View Related

Excel 2010 :: How To Convert Numeric Dates Into Proper Date Format

Aug 21, 2013

I have a column of dates formatted as:

20130201

The cell format in the column is General.

I need to change it so that the format looks like this:

02/01/2013

Is there a quick/easy way to do this in Excel 2010?

View 2 Replies View Related

Convert Jd Edwards Julian Dates Format Into Standard Gregorian Date

Aug 9, 2007

how to convert the JD Edwards Julian date format into standard Gregorian date, and can it be done using VBA? Note that the JD Edwards Julian date is different than the standard Julian Date and uses 6 digits instead of 7.

View 7 Replies View Related

Convert A Date Format To A Text Format

Oct 6, 2008

Example......

In D2 I have: =B2
In D3 I have manually input: (space)3-08

As you can see the CONCATENATE puts the "39569" date in A2 But the second line puts the text date as I prefer. What I would like to do is put in a formula or macro in D2 and down that will change the "Mar-08" to "3-08" so it CONCATENATEs correctly to column A. Simply: I'm trying to avoid manually inputing the text version "3-08" (or whatever M-Y) into D2 down a hundred or so rows!

View 3 Replies View Related

Convert Number Format To Text Format?

Oct 11, 2012

I want to convert number format to text format, any formula ?

View 6 Replies View Related

Convert Text Format To Numbers Format In Vb

Nov 21, 2006

how i convert text format into numbers format in vb.
Currently

i have a formula in vB:

Private Sub Textbox3_Change()
Textbox3 = Val(Textbox1.Value) + Val(Textbox2.Value)
End Sub

however..when i sum it up (in excel) using"=sum" formula...it ooes not sum up

I faced an error "number stored as text"..how to i convert it to numbers format in vb.

View 9 Replies View Related

Macro Or VBA - Search General Format Convert To Date Format

Oct 26, 2012

Every month, I have an import a report to a spreadsheet. At my column A, it supposed to be a date format.

For some reasons, I have a combination of a few cells of date format and a few cells of general format with no order at all.

What I need is: Search in the A column, if date format leave it , if not change from general to date format.

View 2 Replies View Related

Convert Dates To Text ...

Sep 12, 2008

I have a columns with dates such as 10/24/2007. The next column has a count of widgets made that day.

I tried creating a column in between the two that would show only the Month and Year. I intended to base a graph on the converted dates and count, to show how many widgets were made a month. But

the graph breaks down the count to the individual days, ignoring the conversion. Is there a way I can create a column that will literally take the date number and leave only a text in its wake? So that when I slect the latter two columns, the graph will only show the months and counts in that month?

View 9 Replies View Related

Convert Dates To Text

Nov 10, 2009

I need to convert values in column A that Excel has erroneously formatted as date, to text.

4/9/5281 should be 5281049
(Excel dropped the zero in front of the 4. I need it back.)

14/9/5281 should be 5281149

View 9 Replies View Related

Convert Date Looking As Text To Dates

Feb 12, 2009

I have a column wherein the dates are treated as text , i want to convert that into dates.

View 9 Replies View Related

Convert Text To Dates - Cannot Group This Selection

Jun 26, 2014

I am having an issue with converting what seems like Text to Dates. I am trying to group dates in my pivot table, but I keep getting the error "cannot group this selection". My dates are left justified, causing me to believe that they are text.

When I format the cells, however, the cells say that they are already in date format. When I try using Text to Columns in the Data Tab and selecting MDY, I get the error "You cannot move a pivot table table report or insert worksheet cells, rows, or columns."

Not sure what to do from here, as I would like to group dates by weeks.

View 9 Replies View Related

Convert Text To Time Format

Mar 5, 2014

If I had the below in a single cell what formula would I need for it to read just the 30mins in another cell in a time format?

17:30:00 + 00:30

View 12 Replies View Related

VBA - Convert Date To Text Format

Jun 9, 2014

i am looking for vba macro to convert date format (indonesian language) to be text format, see this below :

sample (col.a)
after vba

09/10/14
09 Oktober 2014

26/12/11
26 Desember 2011

05/06/10
05 Juni 2010

etc...

View 6 Replies View Related

Convert Date Format To Text

Nov 13, 2006

I am trying to make a very simple macro but get stuck in de Excel date format. When using the date "=TODAY()" in one cel it is no problem but I want to integrate it in the CONCATENATE function.

I want to create this text "(WG 01-01-2006)" but then with the actual date of that day of course, which can be inserted in de active cell.

Whatever I do, copy, pastespecial, reed text with RIGHT, change format on an temporary cell etc. Excel keeps returning the number in Excel date format counting from 01-01-1900. Nice for calculating but I want the date text!

View 9 Replies View Related

How To Convert TEXT Into NUMBER Format

May 5, 2007

I just copied a range of data from a website however these numbers are in TEXT format.

Basically each number in this data set has a SPACE behind. This turn the number into a text itself and i cannot do a sum for this range of data. I tried TRIM function and also tried to format it to number but no luck. Also tried to mutilply the range to 1 yet they're still in text format.

View 9 Replies View Related

Convert Date To Text Format

Oct 16, 2007

Is there a way to convert date to text of format (number stored as text) either directly using excel formulas or VB macros. We've a requirement to pass today's date as a string in the format of "number stored as text". For this, i've in cell A1 a formula today() which gives today's date 10/15/2007 and I'm looking an output of '20071015 in cell A2 and this should be treated as text with a symbol " ' " before 20071015.

View 2 Replies View Related

Convert Text Entries To Valid Date Format

Jan 23, 2010

Please refer to attached spreadsheet
I receive data from an external source and it displays what appears to be dates in column B.
In column G I apply a formula to display month/year info.

It turns out that some of the data in column B is valid date data, but other data imports as plain text and therefore I can't get the month/year info that I require.
I have attached just a small example.

I get this data monthly and it usually covers thousands of rows and therefore impractical to change manually.

View 6 Replies View Related

How To Convert Any Types Format Into Text With 5 Digits In Selection

Aug 19, 2014

How to convert any types format into Text with 5 digits in selection?

For instance, the content I select is "234", and I want it to convert to "00234". Just like the function "TEXT" in excel. How can I realize it promptly in VBA?

View 12 Replies View Related

Cannot Convert Numbers Stored As Text To Number Format

Dec 14, 2009

There is probably a really easy answer to this question but I cannot seem to figure it out. I need to calculate the sum of pages faxed on a fax report at my office on an excel spreadsheet which is downloaded from our server. It appears the file is not meant to be used in excel but it downloads as an "*.xls" file anyway. When I open the file I receive this message:

"The file you are trying to open, 'FaxCetailReport.xls', is in a different format then specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

The file is comnig from a trusted source so I select "Yes" and it opens just fine. There are just over 50 rows of info, one of them being the number of pages. In a blank cell I enter "=SUM(select rows)" and the result is a "0". I have converted the cells to the "number" format, no change. When I right click on the cells and select format, the protection tab on the right has the check box "Locked" checked and unchecking it does nothing, it is checked as soon as you go back in to the protection tab.

The only way around this is to manually retype the numbers in a cell next to the pages column, which is ok for 50 numbers, but I have some sheets where there is over 1,000 entries.

View 9 Replies View Related

Dates In Text Format

Oct 26, 2006

I am also new to vba (am teaching myself with the help of the guru's on this site!). My problem is to do with dates. I have created a variable in VBA that reads a cell with the value of a date in text format, for example SEP2006. I want to use this value to paste into another excel cell. When I do it actually creates it as a numeric date when I really want to just use it as text, "SEP2006". I have been looking at this for a while and I'm not sure if it's a case of "can't see the wood for the trees". A small example of my code is:

Sub DateValue()
Dim dateValue As String
Range("D2").Select
datevalue=activecell.text
Range("a3", [b65536].End(xlUp).offset(0,1))= datevalue
End Sub

View 3 Replies View Related

Convert Cell Values In Active Range To Text Format

Jul 15, 2014

How can I convert all cell values in active range to text format without losing the actual value.

For Ex.

0123 will remain 0123
07/12/2014 will remain 07/1/2014
3453 will remain 3453

regardless of there previous format. Currently I am doing this manually for every column before creating a load file for SQL database.

View 7 Replies View Related

Macro To Convert Date Format

Sep 6, 2012

I have dates in Col E that are in mm/dd/yyy. I would like a macro to convert these in the format dd/mm/yyyy.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved