我在代码中计算出t的具体数值,想把t带入(10,t,5)并且把最终的具体数值写入txt文件中
就是计算出t=5,在txt中写入的数据是(10,5,5)
vba中数据替换
答案:2 悬赏:80 手机版
解决时间 2021-01-31 12:02
- 提问者网友:山高云阔
- 2021-01-31 06:34
最佳答案
- 五星知识达人网友:青灯有味
- 2021-01-31 06:40
Public Sub Test()
Dim sPath As String
Dim iFile As Long
Dim t As Integer
Dim strTemporary As String
t = 5 ' 计算出t的具体数值
strTemporary = "(10," & CStr(t) & ",5)"
sPath = "D:\Temporary.txt"
iFile = FreeFile()
Open sPath For Append As #iFile
Print #iFile, strTemporary
Close #iFile
End Sub
Dim sPath As String
Dim iFile As Long
Dim t As Integer
Dim strTemporary As String
t = 5 ' 计算出t的具体数值
strTemporary = "(10," & CStr(t) & ",5)"
sPath = "D:\Temporary.txt"
iFile = FreeFile()
Open sPath For Append As #iFile
Print #iFile, strTemporary
Close #iFile
End Sub
全部回答
- 1楼网友:千夜
- 2021-01-31 07:13
sub test()
application.screenupdating = false
dim sht as worksheet
dim rng as range
for each sht in thisworkbook.worksheets
for each rng in sht.usedrange
if instr(rng, "2011年7月") > 0 then rng = replace(rng, "2011年7月", "2011年8月")
next
next
application.screenupdating = true
end sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯