Convert Text String Into Excel Date With VBA

Aug 13, 2013

I have a date range that looks like this (British date style, not US):

edit: I posted an image but it can't be seen for some reason:

Date Range
2010 11/10 17/10
2010 11/10 17/10
2010 11/10 17/10
2010 11/10 17/10

Thus the first cell show 11 October 2010 to 17 October 2010 I want to return just the first day (the week commencing date):

edit: I posted an image but it can't be seen for some reason:

Week Commencing
11/10/2010
11/10/2010
11/10/2010
11/10/2010

I have written some VBA to the best of my ability but it seems clumsy using the FORMAT function. Is there a better of doing this with VBA. I can't seem to find a function in VBA which is the equivalent of the formula function DATE.

Code:
Sub ConvertTextToBritStyleDate()
' dd/mm/yyyy (not mm/dd/yyyy)
' Select the cells containing the dates (not the header)

[Code]...

View 3 Replies


ADVERTISEMENT

Convert Text String To A Date?

Aug 23, 2009

My database has 6 fields names and I have created the following code to capture and post data to the database form a userform. It works but I am sure there is a more efficient and elegant way to do this. The two areas I would like advice are:
1. converting the date string to a date.
2. the line of code where I subtract line6 from line4.

View 3 Replies View Related

How To Convert Date (text String) Into Date Format

Jan 17, 2012

I have these as input entered as text:

January 01, 2011 January 01, 2011 February 28, 2010 May 12, 2011 June 02, 2010 February 28, 2010 May 12, 2011 June 02, 2010 February 28, 2010

but I need it in this DATE format:

MM/DD/YYYY

I need it as a formula to be entered into a cell in excel (not VBA)

View 9 Replies View Related

How To Convert String To Excel Date Format Using Formula Or VBA

Sep 28, 2012

Is there a way to convert the string "Sep 28 2012" to excel date format using a formula or vba?

View 8 Replies View Related

Excel 2003 :: Convert Specific Date Text To Number?

Jun 20, 2014

I want to use a formula, in another cell, to convert ‎"Friday, ‎30 ‎May ‎2014, ‏‎3:47:16 PM" to a value. I am using Excel 2003.

View 2 Replies View Related

Convert And Format Date Time String To True Date Value

Oct 19, 2012

I have a spread sheet with a date colume that reads: 2012-06-27-19 I need to have this read like 06/27/2012 but nothing I do is working I have tried to go to the formatting process and backing the hr:mm out and that doesn't work. I really don't want to go line by line to manually correct this issue.. HENCE ... over 2000 lines

Second question: If I have a column that reads 02/15/2012 and another column that reads 3/27/2012 how to a format a 3rd column to make it read total number of days between 1st date and 2nd date?

View 1 Replies View Related

Convert String To Date

Aug 2, 2013

I have a field in the format of 121031. I need a formula to convert this field to a date DD/MM/YYYY format, so 121031 becomes 31/10/2012.

View 9 Replies View Related

String Of Dates Convert To From And To Date

Mar 12, 2014

I have a spreadsheet with reference relating to dates that are listed as single days. I am trying to convert the single dates relating to a reference to a from and to date but i'm having problems.

Example

048051_14110/09/2013
048051_14111/09/2013
048051_14112/09/2013
048051_14113/09/2013
041929_14115/10/2013
041929_14116/10/2013
041929_14117/10/2013
041929_14118/10/2013

I want this to read

048051_141from - 10/09/2013 - to - 13/09/2013
041929_141from - 15/10/2013 - to -18/10/2013

View 1 Replies View Related

Convert String Number To Date?

May 3, 2013

The following function reads many worksheets in one workbook and put the information into one worksheet. F22 to Q22 is dates in the format of mmm-yy on the many worksheets. On the one worksheet B1, C1, D1, etc... is dates also formatted mmm-yy. Now the many sheets only have a 12 month period but could be any date within 60 months. In the many worksheets the beginning date in F22 is based on the date that is entered into G8 of the many worksheets. The function is:

Code:
Function HrsByMonth(strField As String, MonthNum As Integer) As Long
Dim sht As Worksheet, i As Long, j As Integer
HrsByMonth = 0

[Code].....

View 6 Replies View Related

Convert Number String To Date

Dec 18, 2009

I am trying to convert a number string date that has been stored in a database to a readable date time in an excel pivot table.

1260983366 needs to look like Wednesday, December 16, 2009, 10:09 AM.

The converted date could also look like Wed, Dec 16, 09, 10:09 AM.

View 9 Replies View Related

Convert Text String To Integer

Feb 16, 2014

I've got an odd program that exports time data formatted as a text string. For example....

0:10:25

Since it has no numerical value, then I can't simply "format as number". I'm thinking that I will need to use one of the string methods eg: mid() to check each character individually and then convert that into the equivalent numerical value.

So the numerical output I am looking for in the above example would be 625.

View 2 Replies View Related

Extract Data With Differing Date Formats - Convert Text To Date

Mar 27, 2013

Extract data with differing date formats that I need to convert to something consistent that I can format as a date.

This is an example of data.... all with general format at the moment.

2/28/2013 2:48:53 PM

1/16/2013 10:48:50 AM

12/17/2012 11:59:49 AM

I have used this formula to extract the date portion, but I can't get this to then format as date. How do I convert this to the julian date, so I can then apply a date format?

=LEFT(G9,SEARCH("/",G9)+7)

(The day portion of this date always has a leading zero).

View 9 Replies View Related

Convert A Text Date Into A Proper Date

Jan 9, 2009

I have a column of dates in thie format " January 5 03:09:36 2009" which i need to convert into a proper excel date that i can do further calculations on (adding up things, graphs etc based on dates).

Note the space before the month name. I thought about doing a left(cell,xx) to get it but that isnt going to work with the space infront and the variable length of month names.

I do not necessarily need the time included, it may be useful at some point if its easy to keep it as part of the data, if not i can live without it.

View 6 Replies View Related

Convert Date As Text To Actual Date

Jan 22, 2009

I've been sent a spreadsheet in which one column represents dates, but they have been entered as plain text, MM/DD/YYYY (ie 12/31/2008). I ultimately need to import this as a CSV into a program that only understands dates in the format DD/MM/YYYY.

I'd ideally like excel to recognise this field as containing dates, but I can't figure out how to do that, or even how to swap the days and months around as text. I'm using 2007.

View 4 Replies View Related

Convert Text Date To True Date?

Jun 14, 2012

I have some dates in text fomat on a worksheet that I need to convert them to true dates(Value). Here some sample of the text dates: '12/31/2011; Blank space12/31/2011.

Sub CnvtTextDate()
For Each Rng In Selection
Cells.Replace What:=" ", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:=",", Replacement:="", LookAt:=xlPart, SearchOrder:= _

[code].....

View 6 Replies View Related

Convert A Date To Text?

Nov 13, 2008

If I have =TODAY() in cell A1 with the formatting ddmmyy (which returns 141108 ) how would I covert it to a number in another cell. SEE ATTACHED

View 4 Replies View Related

Convert Text To Date ..?

Feb 27, 2009

How would "April" be converted to "4/1/2009 8:00:00 AM"? The months will vary, but the time will always be 8:00:00 AM.

View 2 Replies View Related

Convert Text To Date

Jun 18, 2009

in columns I and J i have text which reads as for example 20090619. I need to convert this to a date format as in dd/mm/yyyy. A lil macro would help loads. i also have some other spreadsheets that have the date as 16 jun 2009 and i have to basically go into the cell and then hit enter for it to become formatted like the dd/mm/yyyy.

View 5 Replies View Related

Convert Date To Text

Dec 8, 2011

I am trying to convert a date to a particular format (mmm-yy) and then convert it to text.

On the spreadsheet I usually use Text(Today(),"mmm-yy") so I used the WorksheetFunction.Text to accomplish this but is there a VBA method to match this functionality?

View 2 Replies View Related

Convert Date To Text?

Mar 18, 2014

I have this kind of date:

1/11/2014 (dd/mm/yyyy)

I want to convert it to text like this: 01112014

I use =text(a1;"ddmmyyyy") but nothing happens.

View 3 Replies View Related

Convert Text To Date?

Feb 23, 2008

I've been playing around with various formulas to try and get the following to work, but doesn't do it.

What I have is a list of 'dates' in one column, but all seem to have an extra 'space' (so aren't recognised as a date). for example: 31/01/05

Essentially I'd like to convert to a date to find which is the most recent. So far i have tried to use: ...

View 9 Replies View Related

How To Convert A Text To Date

Apr 4, 2009

In the example below , i have in column A data which represent different dates, column B are the currency rate and column D has imported text figures which are not recognized by excel as format dates neither as serial codes !

Though trying to index match the column D data in column A to return the rate of that date , the result is an error ! ...

View 9 Replies View Related

Convert Text To A Date

May 10, 2007

I am looking for a formula that converts:

20070413

to:

39185 (The excel date number for April 13, 2007)

View 6 Replies View Related

Excel 2011 :: Find Multiple Text Strings In Another Text String

Mar 8, 2013

How do I use an Excel formula to find which (if any) multiple sets, each of up to 50 words, exist in a series of rows of a spreadsheet - if set A has one or more words found in a searched cell.

A positive result will return a specific value in the designated result cell. If none of the words in Set A is found in the searched cell, the formulae will repeat the test for the words in Set B, and so on.

After all 50 sets of words have been tested, the formula will move to the next cell in the searched column.

New words will be added to the sets of words continually as required.

Multiple words within sets are included in double quotes. Within each set of words there will be some n-tuples of words (i.e. 24 adjacent words) that contain one or more of the words in the set, but for which the formula will be required to return a negative result. Example: Set A = word 1, word2, word 3, "word1 word2 word3". (The words within a set could also be each entered in separate columns, as opposed to all included in a single cell.) The single column of text to be searched is about 10,000 rows.

I am wanting to use the above in a spreadsheet that contains data downloaded from a series of bank accounts to automatically allocate items of expenditure to one of 20 or so different categories of expenditure.

The formula will search the description field to find words that are used in the in the downloaded files from the various accounts to describe each transaction.

If a word describing travel expenditure (e.g. hotel, "holiday inn" but not "holiday travel") is found in the description of an expenditure item - the item cost will be allocated to the TRAVEL EXPENDITURE column, which is one of 20 or so different categories of expenditure.

Happy to consider a different solution if the task can be done better a different way.

Tried using a combination of INDEX/SEARCH/IF in Excel, but was not able to get a correct result. PS I am using Excel 2011 for Mac - which does not allow macros, so the solution needs to be entirely formula based.

View 1 Replies View Related

Convert Text Cells To Date

Mar 19, 2009

i attached a spreadsheet with the column that needs to be converted to date. When i try to format cells i get a return of ##############. I tried changing to number and text to columns and still get the same result. I need it to look like 08/16/2008 ect.

View 2 Replies View Related

Convert MDY To DMY With Text Version Date?

Dec 12, 2011

I have some date data use MDY format. Want to convert to DMY format. But text to columns function doesn't work as those dates are text not numbers. How can I do the convertion?

examples:

3/14/19644/18/1964

View 9 Replies View Related

Convert Numeric Text To Date

Sep 6, 2012

I have some dates in Excel in different formats and I need to convert them all to a uniform date format of MM/DD/YYYY.

The data is in this format:

82012
8152012
52012
5152012

The days of the month don't really matter. It's the month and year that I need in a date format.

View 2 Replies View Related

Convert Text Comments To Date In VBA

Nov 8, 2012

I have a situation where textual comments are entered into a cell where the comments are supposed to begin with a date in mm/dd format. Some enter all 5 characters but some enter m / d in if appropriate to the date, e.g., 9/6 vs 09/06.

I'm trying to take the left 5 characters and compare that to the current date - 7 to ID aged comments and highlight that cell. I currently do this by populating a variable LastUpdate (dim as string) with the first 5 characters, then run this IF statement.

If LastUpdate < Date - 7 Then
Range("O" & i).Select
Selection = "Comments over 7 days old."
End If

This works find except in situations where there is a zero for the first character after the "/", such as "11/05." The code doesn't properly calculate the date and assumes it's old. "11/5" works just fine. I thought I could try translating the variable into a proper date. I "borrowed" this formula from another post herein: =DATE(2012, MID(N12,1,FIND("/",N12)-1), MID(N12,FIND("/",N12)+1,2)). This works fine as a formula to translate the characters into a date but I don't know how to do this same thing in vba.

View 5 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







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