Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Save a Range on a Workbook as a CSV File
I have a spreadsheet and would like to save data on a particular sheet
as a CSV file. I'm using the following code to save the entire sheet; is there a way to only save a certain range of the data? The problem is that I'm getting commas at the end of the file as well as at the end of each row. FName = "Upload" & Format(Now(), "yyyymmmddhhmm") Sheets("Upload Data").Copy Set wb = ActiveWorkbook wb.SaveAs FName & ".csv", FileFormat:=xlCSV wb.Close SaveChanges:=False MsgBox "Upload File Saved" Thanks. Connie |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Save a Range on a Workbook as a CSV File
Did you try Earl's program?
Connie wrote: I have a spreadsheet and would like to save data on a particular sheet as a CSV file. I'm using the following code to save the entire sheet; is there a way to only save a certain range of the data? The problem is that I'm getting commas at the end of the file as well as at the end of each row. FName = "Upload" & Format(Now(), "yyyymmmddhhmm") Sheets("Upload Data").Copy Set wb = ActiveWorkbook wb.SaveAs FName & ".csv", FileFormat:=xlCSV wb.Close SaveChanges:=False MsgBox "Upload File Saved" Thanks. Connie -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Save a Range on a Workbook as a CSV File
Yes I did and I got it to work by opening another sheet and copying
only the range required and then saving that file as a csv. That worked and removed the commas both at the end of each record and at the end of the file. Thanks again for your suggestion! Connie Dave Peterson wrote: Did you try Earl's program? Connie wrote: I have a spreadsheet and would like to save data on a particular sheet as a CSV file. I'm using the following code to save the entire sheet; is there a way to only save a certain range of the data? The problem is that I'm getting commas at the end of the file as well as at the end of each row. FName = "Upload" & Format(Now(), "yyyymmmddhhmm") Sheets("Upload Data").Copy Set wb = ActiveWorkbook wb.SaveAs FName & ".csv", FileFormat:=xlCSV wb.Close SaveChanges:=False MsgBox "Upload File Saved" Thanks. Connie -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I email amacro? | Excel Worksheet Functions | |||
File Save As -Selected Range | Excel Discussion (Misc queries) | |||
macro save a workbook whilst increasing file no | Excel Worksheet Functions | |||
Inserting Filtered RC cell information into other worksheets | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions |