32

This code will write log file to LogFilePath, and generate output as below. StarRange and EndRange is a variable which value will populate from other function.

"Start postion",A1
"End position",B100

---Code-----------------
Sub WriteLogFile()
 Dim FilePath As String

 LogFilePath = WriteTextBox.Text

LogFilePath = LogFilePath & ".log"
Open LogFilePath For Output As #2

Write #2, "Start postion"; StarRange
Write #2, "End position"; EndRange
Close #2

MsgBox FinalFileName

End Sub

My question is how can I remove double quotation mark from output and produce output as below. Thanks

Start position = A1
End position = B100
ashleedawg
  • 20,365
  • 9
  • 72
  • 105
user1902849
  • 1,113
  • 6
  • 23
  • 33

1 Answers1

74

Write is a special statement designed to generate machine-readable files that are later consumed with Input.

Use Print to avoid any fiddling with data.

Print #2, "Start postion = "; StarRange
Print #2, "End position = "; EndRange
GSerg
  • 76,472
  • 17
  • 159
  • 346