vb 提示“要求对象”,如何解决
PrivateSubWorksheet_Change(ByValTargetAsRange)DimPathAsStringIfTarget<>""AndTarget.Va...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Path As String
If Target <> "" And Target.Value = "OK" Then
Open App.Path & "\Test.txt" For Output As #1
Print #1,
Close #1 '关
End If
End Sub 展开
Dim Path As String
If Target <> "" And Target.Value = "OK" Then
Open App.Path & "\Test.txt" For Output As #1
Print #1,
Close #1 '关
End If
End Sub 展开
2个回答
展开全部
ByVal Target As Range--->Target As Range
追问
出现编译错误,过程编译与事件描述不符
追答
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Path As String
If Target "" And Target.Value = "OK" Then
Open App.Path & "\Test.txt" For Output As #1
Print #1,
Close #1 '关
End If
End Sub
App.Path
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询