![]() |
|
|
FlashChat | Actuarial Discussion | Preliminary Exams | CAS/SOA Exams | Cyberchat | Around the World | Suggestions |
DW Simpson International Actuarial Jobs |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
![]() I'm writing a macro that, after performing some data cleaning, saves my file in a specified directory. The original file is .csv, and I'd really like it to come out in either a xls or xlsx format. Here's my code to save the file:
Code:
Dim newFile As String, fName As String fName = Range("A2").Value newFile = fName & " " & Format$(Date, "mmddyyyy") ChDir _ "C:\Documents and Settings\username\Desktop" ActiveWorkbook.SaveAs Filename:=newFile |
#2
|
||||
|
||||
![]() The next option after Filename is FileType. I think if you added the .xls or .xlsx in the file name it would be correct or if you changed the filetype.
__________________
GAME ON!!!!!!! Let your ![]() Officially assigned the role of Dictator, 9/30/09. Bow to my whims. |
#3
|
||||
|
||||
![]() Quote:
ActiveWorkbook.SaveAs Filename:=newFile, FileFormat:=xlExcel12 |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|