Date format Workbooks Open

I have an application which saves the output to .xls format.  If I open the 
file from Excel, I get the Text Import Wizard.  There is a date/time column 
in format
dd/mm/yyyy hh:mm

However, If I use Application.Workbooks.Open to open the file, the date/time 
column is in format dd/mm/yy hh:mm

ie the yyyy is shortened to 2 digits.  

Manually clicking into a cell and pressing enter updates the cell, as does 
Text to Columns.  I have recorded some code to use Data>Text to Columns, but 
running the code does nothing.  If the dates are in column L, the code is as 
follows:

    Columns("L:L").Select
    Selection.TextToColumns Destination:=Range("L1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, 
Tab:=True, _
        Semicolon:=False, Comma:=False, Space:=False, Other:=False, 
FieldInfo _
        :=Array(1, 4), TrailingMinusNumbers:=True

I have tried different methods of opening the file and of delimiting the 
text after it is open, but can't get the date correct.

Can anyone help?
0
Utf
2/23/2010 4:47:01 AM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
1119 Views

Similar Articles

[PageSpeed] 48

I'm missing something:  If your output is saved to .xls format, how is it 
possible that when you open it again it fires up the Text Import wizard?  Is 
it a text file or a workbook?  Sounds to me as though your app is improperly 
saving it as a text file with an .xls extension.

--- "JasonC" wrote:
> I have an application which saves the output to .xls format.  If I open the 
> file from Excel, I get the Text Import Wizard.  There is a date/time column 
> in format dd/mm/yyyy hh:mm. However, If I use Application.Workbooks
> .Open to open the file, the date/time column is in format dd/mm/yy hh:mm
> ie the yyyy is shortened to 2 digits.  
> 
> Manually clicking into a cell and pressing enter updates the cell, as does 
> Text to Columns.  I have recorded some code to use Data>Text to Columns, but 
> running the code does nothing.  If the dates are in column L, the code is as 
> follows:
> 
>     Columns("L:L").Select
>     Selection.TextToColumns Destination:=Range("L1"), DataType:=xlDelimited, _
>         TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, 
> Tab:=True, _
>         Semicolon:=False, Comma:=False, Space:=False, Other:=False, 
> FieldInfo _
>         :=Array(1, 4), TrailingMinusNumbers:=True
> 
> I have tried different methods of opening the file and of delimiting the 
> text after it is open, but can't get the date correct.
0
Utf
2/23/2010 10:02:01 AM
Reply:

Similar Artilces:

filter by date and action
I have a table with three columns: Name Date Action Fred Today this Fred Today this Fred Today that Wilma Today this I want to sort by name and by date, but only if 'this' was done more than once on the same day, and not if 'that' was done on the same day,They have to perform this more than once, and they cannot have performed that on the same day. If not in excel, mssql maybe? Thanks, Harry On Aug 18, 1:53=A0pm, Harry <hamac...@gmail.com> wrote: > I have a table with three co...

Cannot open attach. within outlook
I am using outlook 2000sr2 on windows NT 4. I am getting a variety of message boxes when I open files. Either: "<file name> is being used by <user>. Do you want to make a copy? (email attachments and Word files) or "A document with the name <x> is already open. You cannot open two documents with the same name, even if the documents are in different folders. To open the second document, either close the document that's currently open, or rename one of the documents." (Excel files). This only occurs when I open the documents directly from email or...

Calculate Years/Months Between Dates and then Average
We are using the formula =DATEDIF(A1,NOW(),"y") & "." & DATEDIF(A1,NOW(),"ym") to calculate the years and months from an employee hire date. Is there an easy way to average the years and months for a group of employees with the results of that formula? You could use: =AVERAGE(A1:A10*1) Array-entered, meaning press ctrl-shift-enter. But you could also just change your current formula to: =1*(DATEDIF(A1,NOW(),"y") & "." & DATEDIF(A1,NOW(),"ym")) Then just use: =AVERAGE(A1:A10) which is *not* array-entered. ...

Cannot open files in Word
I cannot open a file in Word saved in publiser. When I try it shows a window encoding, and shows ms- dos and two choices to pick from, no matter what I pick the document cannot be read.Thank for any help Frank Neither can anyone else. A Publisher file cannot be opened in Word. "Frank" <Frank@discussions.microsoft.com> wrote in message news:E348233B-B3F0-4CC9-9606-1640F454A88D@microsoft.com... >I cannot open a file in Word saved in publiser. When I try it shows a >window > encoding, and shows ms- dos and two choices to pick from, no matter what I > pick the doc...

Transaction Date VS Business Date
Our accounting department needs/wants to have all RMS SO reporting by business date opposed to transaction date. Usually these are the same unless you have sales and batches that close after midnight. For our store I would like to set 3 a.m. as the business day closing time. So when I run any type of reports I would like to get the information for a business date (range) starting at 3 a.m. till 3 a.m. the next day. I guess I could accomplish this by subtracting 3 hours from all the transaction (date and) times but I would have to do this for every single report which would be a lot of ...

IF Function Format -- Microsoft Query
I am attempting to pull data from SQL data table into Excel for pivot table. Field_1 is a value; always positive. Field_2 is a text flag; either "C" or"D". Depending on the flag in Field_2; Field_1 is either positive or negative. What is the format of the entry in Microsoft Query so that a Field_3 can accurately be calculated? In Excel I would entry =if(Field_2="D",Field_1,-Field_1). In Access, the function would be IIF(Field_2="D",Field_1,-Field_1) Unfortunately I have no idea whether it will work with your SQL data. If that fails, you can a...

Post Dated Checks
I had to prepare some post dated checks and we did not have fiscal periods set up yet to match the dates of the checks. Currently the check batches are waiting to be posted. What is the best way to handle post dated checks? If I create new fiscal years to match these dates, I will end up having 4 Open years. Is this the only way to do it? You can manage post dated checks in Microsoft Dynamics GP with the Payment Document Management module available on the Feature Pack 1 DVD image. For more info, take a look at MVP Mohammad Daoud's post on the subject at: https://communit...

How to do a conditional format for multi cells
Lets say based on a value in A5 I would like to change the text format for cells d5:g5 (four columns), what would be the best procedure to do this, can it be done using conditional format if each cell d5,e5,f5,g5 or is there another way. By that do I input a conditional format for each cell d5,e5,f5,g5 (if A5> "xx" then <format>. A big Thank You for all the help. dave Yes, highlight the four cells and apply your conditional format to them all. You will need to use $A$5 as the reference. Pete Hi Pete, This did not work for me. For the "value" I have =$...

Remove "Date: Yesterday" or "Date: Monday" from Outlook Inbox?
Outlook mail inbox now has headers that tell you what day the the email was sent. I find this visually annoying. Each emailalready has the time and day it was sent. I don't need the daily titles in the midst of the list of emails. How do I make them go away? I think you are talking about OL 2003 & the Arrange in Groups setting. Change it in View, Arrange by, uncheck Show in Groups. "silky" wrote: > Outlook mail inbox now has headers that tell you what day the the email was > sent. I find this visually annoying. Each emailalready has the time and day >...

how to save fixed format text file
I have an Excel file which is 269 characters wide. I need to save this file in fixed format but experience line wrap when using the PRN file type. Anyone have an answer to my problem? You might have to use a macro to get the result you want. See if Chip Pearson's text export macro does it: http://www.cpearson.com/excel/imptext.htm -- Jim Rech Excel MVP You have a few choices (try against a copy of your worksheet): I'd either concatenate the cell values into another column: =LEFT(A1&REPT(" ",20),20) & LEFT(B1&REPT(" ",10),10) & TEXT(C1,&...

strange date format problem
Hi, I downloaded some data on excel using Bloomberg. One column has dates and the other has numbers. Dates appear as 01/01/1980 format which I want in Jan-80 format. I have changed the format cell properties but it still appears as 01/01/1980. I have to goto individual cell and press F2 <enter> so see the effect. Dont know why? I cant even copy paste format after that .... TIA/amag I am not sure, but is your workbook set to Auto-Recalculate? Try pushing <F9> to do a manual re-calculation, see if that changes the formats. If it does, go to Tools (on the menu bar), Options, Ca...

How to sort by name then date?
I would like to look through all the emails to a particular person. If I click on the "To" column I can see all the emails to a particular person (actually there is a problem with that which I will mention next) but they seem to be in random order. Is there a way to have them sorted by date? (i.e. by name first, then by date). Actually, sorting on the "To" column does not get all the emails sent to a given email address. Because Outlook uses the "display as" field. It will often give different "display as" names to the same email address. C...

Open to Buy
Hi all, Anybody familiar with the "Open to Buy" concept in retail operations? I think the concept refers to a Buyer being able to purchase a set quantity or amount within a certain timeframe, say one year. Any thoughts or sources of information where I can research this concept will be greatly appreciated. Thanks! http://www.retailowner.com/inventory/otb.asp http://www.opentobuywizard.com/index.html >-----Original Message----- >Hi all, > >Anybody familiar with the "Open to Buy" concept in retail >operations? I think the concept refers to a Buyer ...

Concatenate including a date so that the date appears as a date
When I try to join the contents of several cells, one of which is a date and time obtained from =now(), the date and time part appears as a number. How can I make it appear as a date and time? I have tried changing the cell formats - probably there is a combination that works but I haven't found it. I also tried copying the original date cell to another cell and changing the latter cell's format and concatenating using that latter cell, but still no success. Use the TEXT function. For example, =TEXT(NOW(),"mmmm d, yyyy") would give January 6, 2010 "dd...

Comment print format
Hello, I am trying to change the text that says Cell: Comment: when I print my Comments at the end of my form. Is this text embedded by Microsoft? Thanks, Bob Hi Bob have a look at this thread http://tinyurl.com/3xq6h Frank GT40 wrote: > Hello, > I am trying to change the text that says Cell: Comment: > when I print my Comments at the end of my form. Is this > text embedded by Microsoft? > Thanks, > Bob Frank OP wants the printed comments to not show the Cell:A1 Comment:whatever The codes at your URL just change the on-sheet comment format, but the printed ...

When I open Excel, 3 un-requested xls.docs are opened. Why?
Each time I open my Excel program, three excel documents open as well. I want to change this so it does not happen. How do I do this? Thanks Lisa Lisam wrote: > Each time I open my Excel program, three excel documents open as well. I > want to change this so it does not happen. How do I do this? > Thanks > Lisa At startup Excel will automatically open any file stored in the XLStart subdirectory. To find whether this subdirectory is in it's default location, or whether it's been redefined elsewhere, click on Tools>Options>General and look at the startup fi...

if statement with dates #2
I would like to have a statement like: IF(a1>0,1/1/2004) with 1/1/2004 beint a date. EXCEL is interpreting 1/1/2004 as an arithmetic statement and giving me the result of the arithemtic. I could put in the numeric offste for the date and write IF(a1>0,37987), formatting the cell as a date, but this seems awkward. What else can I do? TIA, Sanford ...

Save single worksheet as new workbook
I have a workbook containing multiple worksheets. I would like a macr that would save a single worksheet as a new file. Also, can I have th new file be saved as the data in a certain cell? I have a macro that will save the worksheet to a new workbook, but i saves it with the same filename each time. Please help! Thanks -GorillaBoz -- Message posted from http://www.ExcelForum.com Hi GorillaBoze One way is to use a date time stamp in the file name Example that save the activesheet in C:\ Or look in the VBA help for Application.GetSaveAsFilename Sub CopySave_ActiveSheet() Dim wb As...

Underlined formatting comments in Word 2003
Some days ago I got some good tips from readers in this forum, re unwanted red colored, underlined, formatting comments in plain documents. Comments which I printed, but somehow have lost. These comments have now popped up in some other document. When I am inside this document, it seems as if I really managed to get rid of the formatting comments. Then I save the document in normal way, then exit from Word 2003. Next when I open up the same document, those underlined comments come up again. Feel like a little swearing !! -- ___________ Knut Willy Double-click TR...

Count Unique Cells, within a date range (dates stored in separate column).
Hello All: I am attempting to create a formula that will count the number of unique cells (alpha-numeric) in an entire column (no set length, so ex: "$B:$B"). This count will be based on a date range (Between 2 dates). The dates are stored in another column (Ex: "$A:$A"). The following is an example of the cells. Dates PO_Num 1/2/2010 A123456 1/3/2010 B453453 2/2/2010 A123456 3/4/2010 C2342F3K 4/3/2010 123456 I would like to know a formula that can count the number of different PO's based on a given date range. Please help me if you...

Links error when insert line/row to source workbook
I have a question regarding links on Microsoft Excel 2003. If I insert a line into the source spreadsheet, the link on the destination spreadsheet doesn't work anymore because the cells moved. The scenario: On the destination spreadsheet, the link is =[ACME.xls]Sheet1'!A1 But if I insert a line on ACME.xls, making the info in cell A1 move down to A2, the link on the destination spreadsheet still pulls from cell A1. How do I ensure that when I insert/delete lines/row, the link still pulls info from the correct cell? Thanks Stella If you have the workbook with the fo...

When sending mail, it opens Pictureit!
When I go to send mail, Outlook is opening Microsoft Picture It! Publishing 2001. I cancel normally before it goes all the way thru. But if I let it go, it gets as far as needing the disc. It still sends my mail, but is very annoying. Any suggestions on what this might be? ...

Counting Dates?
=COUNTIF(A1:A100,"<" & NOW()) This works good for specific cells. I have a similar question. How would I do the same thing given that: 1) You only have a starting date 2) Your only wanting to count work days (in this case 4 day/wk) up to NOW() Thank you for all your help. Aviator On Thu, 6 Jan 2005 12:53:03 -0800, "Aviator" <Aviator@discussions.microsoft.com> wrote: >=COUNTIF(A1:A100,"<" & NOW()) > >This works good for specific cells. I have a similar question. > >How would I do the same thing given that: >1) You only ha...

Same format using =
I have a cell (let's say A1), that is formatted with a fill color, a specific font, and a specific font color. I have another cell (A5) that has the formula =A1. How can A5 have the same formatting as A1 and not only its value ? thnks Stabilo, Select A1 Edit-Copy Select A5 Edid-Paste Special-Formats-OK Hope this helps Pete "stabilo" wrote: > I have a cell (let's say A1), that is formatted with a fill color, a specific > font, and a specific font color. I have another cell (A5) that has the > formula =A1. How can A5 have the same formatting as A1 and no...

Losing formating going from Word 2002 to Outlook 2002
I have been driving myself crazy trying to figure out why I am losing m formating when try to send a newsletter in word using outlook 2002 fro within word. When the email is received, the formating is all messed up. I tried to save the document as a web page and then send it but it i still received messed up. The newsletter is four columns wide, has text and graphics and wa saved and sent as all three different types (RTF, HTML and a norma word docutment) and still not luck. Can any one offer any advise ----------------------------------------------- ~~ Message posted from http://www.Exc...