Write to text file without quotes in vba in Excel

Sample code

Open "C:myfile.txt" For Output As #1 Len = 120
record = "Message1"
Write #1, record
record = "Message2"
Write #1, record

Is there a way of not having quotation marks in the file?

Answer:

Instead of using Write #1, record   use the Print #1, record.

(for formulas, depending on your country, you might have to change ; with , or the opposite

 Other excel answers

 

 

You can find similar Excel Questions and Answer hereunder

1) How can I export a WorkSheet as a PDF using VBA?

2) How can I prevent users from seeing / accessing my macro code?

3) How can I set Page orientation, Zoom % , Title Rows and footer using VBA?

4) How to handle errors in VBA with the handling error methods

5) Want to use Microsoft Outlook in Excel. Here some basic explanation to get you started

6) Vba length of an array in Excel

7) How can I add a legend to a chart using VBA?

8) How can I update a listbox based on data in a list using VBA?

9) Excel 2010 vba replacement of application filesearch in Excel

10) How can I add a WorkSheet and name it as required using VBA?

 

Here the previous and next chapter