Loop Converting Date To TEXT Format

Jul 21, 2009

i'm trying to convert a column (P) from date dd-mmm-yy, subtract 5 days, and paste value as YYMM using a macro. I've borrowed bits from other macros and producted this but it's not working (and i've played around with it to the point it doesn't make sense anymore!)

Option Explicit

Sub ADD_REPORT_DATE()
Dim LR As Long, i As Long
Dim tempValue1
Dim tempValue2 As Date

Worksheets("Report").Select
LR = Range("P" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1

Set ActiveCell.Value = Text(ActiveCell.Value - 5, "YYMM")

Next i
End Sub

View 9 Replies


ADVERTISEMENT

Converting Date And Time From Odd Text To Standard Format?

May 10, 2014

I'm copying data from another source to excel, and for certain date entries they come as text in the following format "On 14 May at 8:00". Is there anyway to convert multiple entries like this into a standard date format? With or without time is fine - just the date will do.

View 4 Replies View Related

Converting Text To Military Date Time Group Format

Apr 12, 2014

I am trying to find a way to have excel recognize text data input as date/time.

[Code] .....

Where 02 Is the Date, 2020 is the time (military) Z is Zulu/GMT, MAR is Month and 14 is Year. I believe excel recognizes

[Code] .....

But I have a spreadsheet (on a confidential system) with thousands of entries that I need to convert. Also, the people I have working for me are not remotely. I reject the idea of entering data that way.

I am also trying to keep the display the same format: ddhhmm"Z" MMM yy

View 9 Replies View Related

Excel 2010 :: Converting Text Into Date Format - Error Occurred

Mar 20, 2012

Formating Date Issue

--

Excel or Access version:Excel 2010

Computer operating system:Windows XP

Sample data:No sample data

Formula(s) right now:Mar-5-2012

Current result(s):Mar-5-2012

My goal:To convert the above text into a date format.

Error message:Can't format the way I want it.

How error occurred:No error message

Generated in:Excel

View 3 Replies View Related

VBA Loop Through Worksheet And Format Each Column As Text, Or Date Based On Header

Jun 30, 2006

I am trying to figure out a way to condense my code (improve my code) Right now I am using a Macro in Excel to go through a workbook by selecting each column individually and if there is something in the header then formatting that column as text. The problem with the way I am currently doing it, is that due to size limitations on the VBA code, I can only select columns A to Z, and if there is more data in the worksheet it is not formatted. Also I would like the code to check the header and if the word date is in there, format it as a date instead. Also if there is a way to delete any invalid ranges in the workbook

Sub Format()
Dim VarFileName As String
Dim VarPath As String
Dim VarSavein As String
Dim wsheet As Worksheet
VarSavein = Sheets("sheet1").Range("C2").Value
VarFileName = Sheets("sheet1").Range("A2").Value
VarPath = Sheets("sheet1").Range("B2").Value
Workbooks.Open VarPath & VarFileName
For Each wsheet In ActiveWorkbook.Worksheets
Sheets(wsheet.Name).Select
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:= Array(1, 2), TrailingMinusNumbers:=True..........................................

View 3 Replies View Related

Converting Times Stored In Date Format To Number Format?

Mar 31, 2014

One of the reports I run provides me information on lengths of time. Such a field displays as |0:09:16| indicating 9 minutes and 16 seconds. However, when the report generates the excel spreadsheet it saves these cells in date/time format ([h]:mm:ss). If I were to convert this field to the number format (so I can manipulate and graph it) it displays as such |0.00643460648148148| Ideally I would be able to have the data in the field stored as |556| (556 seconds, or 9 minutes 16 seconds). I have thousands of fields that I need to manipulate where the data is stored in this format and I can not figure out how to fix it.

View 5 Replies View Related

Converting Binary Date To Date / Time Format

Jun 9, 2014

I have a list of dates stored via the following :

20100101 how can I convert this to date/time format to show 01/01/2010?

View 4 Replies View Related

Military Date Format Needs Converting To Civilian Date Value

Jun 21, 2013

I have a program that exports the date as 20120621 (4 digit year, 2 digit month, 2 digit day). I have tried =datevalue(cell) but it returns #value!. I have tried =today()-(cell) and it also returns #value!. Is there a formula or something I can do to covert this field to a date?

View 3 Replies View Related

Converting To Date Format

Aug 22, 2008

I collect data from a data historian and I'm having difficulty with a date format. The collected data is saved in a txt file and imported to Excel 2007.

The date returned by the historian is the following format

9/30/2007 8:45:18.000 PM

This format is not recongnized by Excel as a date format but as a text box.

How can I change this to a date format without having to change all the dates and times manually (over 10 000 dates)?

View 9 Replies View Related

Converting Numbers Into Date Format...

Jan 15, 2007

I have a spreadsheet which has the date set out like this: 20070101

If there any way i can change this to either 2007/01/01 or 01/01/2007?
I have tried using the date format (in the cells) but it just comes up with ######## i tried expanding the cell but no luck, this is very importand that i do this as its for a customer.

View 9 Replies View Related

Converting? Format To Text Format

Sep 15, 2009

On the attached example i have a list of fractions (in the format ?/???). However, i have a problem when the fraction is 6/4 or 4/6 as excel rounds the nominator and de-nominator down to the lowest value so these fractions become 3/2 and 2/3. For these two fractions only i don't want this rounding down to happen.

I am open to any suggestions, but i was thinking of some vba where on pressing a button it would run a macro that went through the cells in the column and if the cell value is 1.5 (3/2) then format the cell as text and enter the value"6/4". For the 2/3 fraction, i think you may need to say if the cell is greater than 0.66 and less than 0.67 because this would possibly be harder to exact as the number of decimal places involved.

View 6 Replies View Related

Auto Converting Numbers To Date Format?

Dec 20, 2012

I've been having a problem lately with Excel automatically converting all of the cells on my spreadsheet from standard number format to dates. I've created several spreadsheets for calculations and all the cells in the number formats that I wanted. It's been saved and actually reopened and used several times. I opened it this morning and now half of numbers are now converted to dates. I've had this happen several times on several different spreadsheets. Why is this happening? Is there a setting somewhere that I need to change?

View 1 Replies View Related

Converting Date Format In Formatted Column

Oct 9, 2013

I have a column that contains dates from our system that displays in "mmddyyyy" format (i.e., 10121999 or 8121998). How do I convert this to a 10/12/1999, 8/12/1998 formatted column?

View 1 Replies View Related

Converting Imported Data To A Date Format

May 1, 2002

I am importing data from my AS400 in Excel, the dates are coming into the spreadsheet as numerics. How do I convert these numbers into a date format? i.e. 3202002 should be 3/20/2002, how do I get the number to that format?

View 9 Replies View Related

Converting A Text File To .xls Format

Oct 21, 2008

I have received a large file of text and numbers arranged (loosely) in columns in a .txt file that I need to get into a usable form in Excel. I'm trying to use the Text Import Wizard but am running into problems geting the column breaks right as there are thousands of rows of data items. As soon I think that I've inserted the break line in the correct place I scroll down a little further to find an item that encroaches into the next column, and when I shift the break line to the right to accommodate this new item I then encroach on the items in this next column.

View 2 Replies View Related

Keep Number Format When Converting To Text

Jun 30, 2009

I have an excel file that is used to create a large text file. This is all done manually so I wrote some code to create the file automatically. I have everything working except that I am losing some info. The info is zeros after the decimal point. Almost all of the cells are formatted as numbers with 3 decimal places. It is common to have values of 0.000 that end up just 0 when they are written to the text file. Is there a way to keep the formatting (all decimal places)? Here is an example of code that I am using to write data directly from a cell to the file.

View 2 Replies View Related

Converting General String Month To Date Format?

Jan 18, 2013

I have a cell which says November , 2012 in General format

In the next cell i want a date of the following month . Eg : 1-Dec-2012.

I tried =DATE(RIGHT(G4,4),LEFT(FIND(",",SUBSTITUTE(G4,",",",",1))),1)

View 1 Replies View Related

Excel 2010 :: Converting Persistent Date Format?

May 27, 2014

I have a Column of dates in this format: 5/19/2014 8:08:44 AM I am trying to get this to read 20140519 or yyyymmdd It doesn't matter what format I change to, it will not update unless I activate the cell and then tab or enter out of it. I have 3000 rows to convert. with this either by setting or VB Sub?

Excel 2010

View 3 Replies View Related

Converting Crazy Date Format To An Excel-useable One

Nov 27, 2009

I have a long series of dates (month and year) formatted like this:

1969.051969.061969.071969.08

In other words, these are May '69, June '69, July '60 and Aug '69.
I cannot get excel to recognize them properly. How can I conver these into an excel-recognizeable date format?

View 9 Replies View Related

Converting Excel File Into Text Format?

Jul 17, 2014

code to convert excel file format into Text.

We are doing this activity on a daily basis to upload into our EPM system , where our system only accepts TXT file.

find enclosed excel input file and output file which should be in TXT format.

View 6 Replies View Related

Converting A Text Format Field From M10235 To M000010235

Jul 10, 2014

I am using excel to compare data from one spreadsheet to another. However my utility is not capturing identical matches since one worksheet eliminated the leading 0s while the next worksheet includes all 0s. Our system should actually have the 0s to identify the data correctly.

Worksheet 1
M10235
Worksheet 2
M000010235

I would like to convert Worksheet 1 to show M10235 in the format M000010235 so that the number contains the prefix M followed by nine digits.

View 2 Replies View Related

Converting Text To Numbers To Useable Number Format

Sep 29, 2008

Is there anyway of converting the output (which is 7 and in text form) to a useable number format so that I can take advantage of the VLOOKUP function (instead of getting a #N/A)....

View 9 Replies View Related

Converting Text To Date And Sorting On Date

Mar 10, 2014

I am trying to convert a long list of dates from text to date (see A) so that I can sort them from newest to oldest. I've tried converting them using differnt formulas (see B:C) but these don't work.

View 8 Replies View Related

Converting Text To Date?

Sep 25, 2013

I have imported data that is showing dates as 18th Sep 2013. Excel does not like this and I have tried various methods of conversion but nothing seems to work. I will be getting data that has Oct, Nov, Dec etc so the formula needs to be able to handle these too. I would like these 'dates' converted to excel friendly dates.

View 7 Replies View Related

Converting Text To Date

Dec 18, 2007

I have few dates in column C. My Column B is blank. I want to convert all text in column C in proper date format in Column B.

The dates entered in column C is in this format 05.11.2007 (dd.mm.yy format) Is there any formula to convert it in proper dates in same which will show the date in 5-Nov-2007 format?

View 9 Replies View Related

Converting Text To Date / Time?

Apr 1, 2014

I am trying to convert text in a cell from: 03/08/2014 2330 to a date that looks like this: 03/08/2014 23:30. Then I also need to extract just the time only and put that in a new cell.

I can do it in a few steps by using Data -> Text To Columns, formatting the date and time separately, and then putting them back together again.

Is there a 1-step way to do the original text to date/time conversion?

View 6 Replies View Related

Converting 1900 Date System To Text

Jan 30, 2009

How do you convert a range of dates in this format: 39843 (i.e today 30th of Jan 2009). To text like: 20080130. Secondly, For the same date, how do you make the weeknum function give answer '05' and not just '5'

View 2 Replies View Related

Converting Date Column To Text Formatting

Mar 9, 2009

I have column A set up to display dates in the following format: 03/04/2009. While the "look" is fine for the values in the column, I cannot get it to stay in that format when it is moved to a text file. It simply converts the display back to 39876.

I would like a macro that 1) looks at all values in column A and 2) converts each cell in the column to text format but leaves the contents so they are dates 03/04/2009 (mm,dd,yyyy).

View 2 Replies View Related

Excel 2010 :: Converting Text To Date?

Aug 20, 2013

i have the text as string data in column A and it is just a text not date format. i want to convert this using formula text function to get result shown in column B and C. is this doable?

Excel 2010ABC1DateRevised DateRevised Date 2Fri 4 Feb 2011Friday, February 04, 20112/4/20113Fri 5 Oct 20074Fri 28 Apr 20065Fri 30 Sep 20056Fri 23 May 20087Fri 3 Feb 20068Fri 30 Sep 20119Fri 11 May 200710Tue 1 Jan 201311Fri 13 Aug 201012Tue 25 Jun 201313Fri 8 Jun 201214Fri 25 Mar 201115Fri 12 Feb 201016Fri 5 Sep 200817Fri 6 Nov 200918Fri 6 Mar 200919Fri 21 Aug 200920Fri 6 Jan 201221Fri 5 Jan 200722Fri 15 Jan 201023Fri 12 Jun 200924Fri 7 Jul 200625Fri 21 Oct 201126Fri 31 Oct 2008Sheet4

View 5 Replies View Related

Extract Fraction From Text Without Converting To Date Serial Number

Jul 16, 2009

I have a cell with the following text in it that is being imported from a website "5/1 Smith T win". What i want to do is extract the "5/1" part without it being in the format of a date. I want it to be extracted in the format "?/???". I have entered the following formula to extract the "5/1"

View 2 Replies View Related







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