Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a macro that pulls data from a database and formats it prior to saving it into a csv file. This macro has worked perfectly for 6-7 months but recently it has started to fail. The date formatting does not save into the csv file. Below is the coding... ActiveSheet.Rows(1).Delete Columns("A:A").EntireColumn.AutoFit wk.Sheets("sheet1").Range("B:C,H:H").Select wk.Sheets("sheet1").Range("H1").Activate Selection.NumberFormat = "m/d/yy h:mm" wk.Sheets("sheet1").Columns("E:F").Select Selection.NumberFormat = "0.000000" wk.Sheets("sheet1").Range("B1").Select Selection.Sort Key1:=wk.Sheets("sheet1").Range("B1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom PivotName = "aep_tx_forecast_cc_short_" & Format(GetValTime, "yyyymmdd") wk.SaveAs "Y:\ALLEGRO-UPLOAD\LSHAPES\PROD\TEXAS\" & PivotName, xlCSV 'wk.Close (False) As you can see i have recently commented out the close command. If I don't close the file and manually resave, the file saves the formatting correctly. So basically, only manually saving the file will give me the date formatting I need. Any thoughts? I am running Excel2000 9.0.4402 SR-1 Thanks! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date value conditional formatting or Macro | Excel Discussion (Misc queries) | |||
Date Formatting in a Macro | Excel Discussion (Misc queries) | |||
Click on cell-calendar drops down-click on date-date fills cell. . | Setting up and Configuration of Excel | |||
csv file drops zeros at beginning of a set of Numbers | Excel Discussion (Misc queries) | |||
Formatting Date Macro | Excel Programming |