Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi. Below is a very simple macro.
Sub WriteText() Open "test.html" For Append As #1 Write #1, "<HTML</HTML" Close End Sub All I want to do is create an HTML file based on user inputs. But whe I run the above code, the file displays the following: "". The sourc code displays: "<HTML</HTML". How do I keep those quotation mark from showing up? Thanks. Bill -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Take a look at
http://www.mcgimpsey.com/excel/textf...ml#csvnoquotes In article , margrabe wrote: Hi. Below is a very simple macro. Sub WriteText() Open "test.html" For Append As #1 Write #1, "<HTML</HTML" Close End Sub All I want to do is create an HTML file based on user inputs. But when I run the above code, the file displays the following: "". The source code displays: "<HTML</HTML". How do I keep those quotation marks from showing up? Thanks. Billy --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the response. Unfortunately, I was unable to access th
page. Could be something on my end, I don't know. Could you post th text in a message here? Bill -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Text files with no modification
This macro will output a text file without surrounding cells which have commas in quotation marks, or doubling quotation marks in the text: Public Sub TextNoModification() Const DELIMITER As String = "," 'or "|", CHR(9), etc. Dim myRecord As Range Dim myField As Range Dim sOut As String Open "Test.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 Range(.Cells(1), _ Cells(.Row, Columns.Count).End(xlToLeft)) sOut = sOut & DELIMITER & myField.Text Next myField Print #1, Mid(sOut, 2) sOut = Empty End With Next myRecord Close #1 End Sub This page last updated Sunday, 4 January 2004 © Copyright 2001 - 2004 McGimpsey and Associates. Except where noted, all code on this site may be distributed under the Gnu GPL. Acknowledgement is appreciated. "margrabe <" wrote: Thanks for the response. Unfortunately, I was unable to access the page. Could be something on my end, I don't know. Could you post the text in a message here? Billy --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To eliminate the " at the start and and of each line that you get whe
using Write #1, "<HTML</HTML" try using Print #1, "<HTML</HTML -- Message posted from http://www.ExcelForum.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try replacing Write with Print.
-- Regards, Tom Ogilvy margrabe wrote in message ... Hi. Below is a very simple macro. Sub WriteText() Open "test.html" For Append As #1 Write #1, "<HTML</HTML" Close End Sub All I want to do is create an HTML file based on user inputs. But when I run the above code, the file displays the following: "". The source code displays: "<HTML</HTML". How do I keep those quotation marks from showing up? Thanks. Billy --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Quotation Marks as Text | Excel Discussion (Misc queries) | |||
Generating text surrounded by quotation marks | Excel Discussion (Misc queries) | |||
CSV File and Maintaining Quotation Marks in TXT | Excel Discussion (Misc queries) | |||
How do I concatenate text that actually contains quotation marks? | Excel Worksheet Functions | |||
eliminating quotation marks when writing to a text file | Excel Programming |