Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
quotation marks before and after each input
JE,
I did get it to work and thanks again. Can you tell me how to add the double quotes on the end column. If I have a blank column in the the middle it will put the double quotes, but my last column is currently blank and I need the double quotes there. Also, If I have a dollar sign, such as $45.00, it adds and extra space after it and before the quotes such as $45.00 " Can you help me on these??? Thanks. --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
quotation marks before and after each input
This modification will output a fixed field text file with quotes around
each item. Adjust NUMFIELDS as necessary. The space after $45.00 comes from your formatting (e.g., Currency formats as $0.00_(, to allow positive and negative numbers to line up). Using RTrim removes any trailing spaces: Public Sub OutputQuotedCSV() Const QSTR As String = """" Const NUMFIELDS As Long = 10 Dim myRecord As Range Dim myField As Range Dim sOut As String Open "File1.txt" For Output As #1 For Each myRecord In Range("A1:A" & _ Range("A" & Rows.Count).End(xlUp).Row) With myRecord For Each myField In myRecord.Resize(, NUMFIELDS) sOut = sOut & "," & QSTR & _ Replace(RTrim(myField.Text), QSTR, QSTR & QSTR) & QSTR Next myField Print #1, Mid(sOut, 2) sOut = Empty End With Next myRecord Close #1 End Sub In article , iamalex wrote: JE, I did get it to work and thanks again. Can you tell me how to add the double quotes on the end column. If I have a blank column in the the middle it will put the doublequotes, but my last column is currently blank and I need the doublequotes there. Also, If I have a dollar sign, such as $45.00, it adds and extra space after it and before the quotes such as $45.00 " Can you help me on these??? Thanks.---Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
quotation marks before and after each input
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Quotation Marks | Excel Discussion (Misc queries) | |||
Quotation Marks? | Excel Worksheet Functions | |||
without quotation marks? | Excel Discussion (Misc queries) | |||
Quotation Marks - When and What?? | Excel Discussion (Misc queries) | |||
quotation marks | Excel Worksheet Functions |