+ Reply to Thread
Results 1 to 3 of 3

date format in save as text macro

Hybrid View

  1. #1
    Registered User
    Join Date
    12-03-2008
    Location
    Portugal
    Posts
    2

    date format in save as text macro

    Hello,
    I'm desperate trying to find a solution for this:

    I run the same macro in two computers and I'm getting different results in each computer, so, the problem should be the computer configuration, no?

    The macro saves a sheet in text format and, in one of the computers, I'm getting the date cells saved in mm/dd/yy format, which is not the format I want to get, even having those cells correctly formatted to dd/mm/yy.

    In one computer, everything works fine, but, in other computer, if I save the file as text mannually, I get what I want: dates in dd/mm/yy, but in this computer, if I use the macro, that doesn't happen and I get the dates in mm/dd/yy.

    .....
      ' Save the file as Text File
            TextFile = "C:\JDEFiles\" & MacroName & ".txt"
        
            ActiveWorkbook.SaveAs FileName:=TextFile, FileFormat:= _
            xlText, CreateBackup:=False
    .....

    Thank you for any help!

    Alberto
    Last edited by royUK; 12-03-2008 at 06:55 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Please take the time to read the Forum Rules & use Code Tags in future. Yopur code saves the file as the variable MacroName
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    12-03-2008
    Location
    Portugal
    Posts
    2
    Thank you for your answer.

    The problem is not the filename, is the date format of some cells - those with dates in it - saved inside the crated text file.

    a.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1