从VBA中的write语句中删除双引号 [英] Remove double quotation from write statement in vba

查看:482
本文介绍了从VBA中的write语句中删除双引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码会将日志文件写入LogFilePath,并生成如下输出. StarRange和EndRange是一个变量,其值将从其他函数填充.

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

推荐答案

Write是一条特殊语句,旨在生成机器可读文件,以后供Input使用.

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

使用Print避免摆弄数据.

Print #2, "Start postion = "; StarRange
Print #2, "End position = "; EndRange

这篇关于从VBA中的write语句中删除双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆