View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Enclosing values in Quotation marks

Don't think that approach will give you what you want - you will end up with
more double quotes than you bargained for if you were successful (plus there
is no command to do that anyway - not sure why you think pastespecial will
put in doublequotes).

See this article for code that should produce the csv file you describe.

http://support.microsoft.com/default...48&Product=xlw
XL2000: Procedure to Export a Text File with Both Comma and Quote Delimiters

--
Regards,
Tom Ogilvy


"bypass " wrote in message
...
I am currently using the script below to copy values from one sheet to
another.

I am hoping to get all values copied to the destination sheet enclosed
by quotation marks (eg "value1"), so that I can then save the sheet as
a .CSV file for a dataload.

Can anyone please suggest a modification to the sub below that would do
this?

Sub CSV()
Dim DestSheet As Worksheet, SrcSheet As Worksheet
Set SrcSheet = ActiveSheet
Set DestSheet = Sheet2
With SrcSheet
Activate
Range(.Range("a3"), .Range("a3").End(xlDown)).Resize(,
34).Copy
End With
With DestSheet.Range("a1")
PasteSpecial xlPasteValues
PasteSpecial xlPasteFormats
End With
End Sub


xl2000 on windows 2K


---
Message posted from http://www.ExcelForum.com/