View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default writing excel macros

Check that cells in Excel do not contain spaces or some other non printing
characters.
You may get some extra blank columns, because of the way Excel parses the
data (in blocks of 16 rows), but this should not affect the whole row.

NickHK

"TMiGNa" wrote in message
...
I'm still getting all the excess commas - sorry...

"NickHK" wrote:

Make a back up of your original file first, then replace your code with
this.
Does this achieve your aim ?

Sub Save_EF_as_csv()
Dim RetVal As Variant

Sheets("Electronic File").Copy
RetVal = Application.GetSaveAsFilename(, "CSV File (*.csv),*.csv", ,

"Select
a file name and location")
If RetVal = False Then Exit Sub

ActiveWorkbook.SaveAs RetVal, xlCSV
ActiveWorkbook.Close False

Sheets("Print File").Select
End Sub

NickHK

"TMiGNa"

...
"NickHK" wrote:

Post what you have at the moment, as long as it's not pages long.

NickHK


--------------------------------------------------------------------------

---------------

Sub Save_EF_as_csv()
'
' Save_EF_as_csv Macro
' Macro recorded 2/4/2005 by KClifford
'

Sheets("Electronic File").Select
Cells.Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,

SkipBlanks:=
_
False, Transpose:=False
ActiveWorkbook.SaveAs Filename:=Application.GetSaveAsFilename(""),
FileFormat:= _
xlCSV
ActiveWindow.Close , SaveChanges:=False
Sheets("Print File").Select
End Sub