excel vba 应用程序定义或对象定义错误
代码如下SubSimpleFilter()DimstrAddressAsStringstrAddress=ActiveCell.CurrentRegion.Address...
代码如下
Sub SimpleFilter()
Dim strAddress As String
strAddress = ActiveCell.CurrentRegion.Address
Worksheets("Sheet1").Range(strAddress).AutoFilter Field:=3, Criterial:="=10"
MsgBox (strAddress)
End Sub 展开
Sub SimpleFilter()
Dim strAddress As String
strAddress = ActiveCell.CurrentRegion.Address
Worksheets("Sheet1").Range(strAddress).AutoFilter Field:=3, Criterial:="=10"
MsgBox (strAddress)
End Sub 展开
展开全部
Sub SimpleFilter()
Dim strAddress As String
strAddress = ActiveCell.CurrentRegion.Address
Dim rng As Range
Set rng = Worksheets("Sheet1").Range(strAddress)
If Worksheets("Sheet1").AutoFilterMode Then Worksheets("Sheet1").AutoFilterMode = False
rng.AutoFilter
rng.AutoFilter Field:=3, Criteria1:="=10"
Set rng = Nothing
MsgBox (strAddress)
End Sub
Dim strAddress As String
strAddress = ActiveCell.CurrentRegion.Address
Dim rng As Range
Set rng = Worksheets("Sheet1").Range(strAddress)
If Worksheets("Sheet1").AutoFilterMode Then Worksheets("Sheet1").AutoFilterMode = False
rng.AutoFilter
rng.AutoFilter Field:=3, Criteria1:="=10"
Set rng = Nothing
MsgBox (strAddress)
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sub SimpleFilter()
Dim strAddress As String
strAddress = ActiveCell.CurrentRegion.Address
Worksheets("Sheet1").Range(strAddress).AutoFilter 3, "=" & 10
MsgBox (strAddress)
End Sub
Dim strAddress As String
strAddress = ActiveCell.CurrentRegion.Address
Worksheets("Sheet1").Range(strAddress).AutoFilter 3, "=" & 10
MsgBox (strAddress)
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Criteria1这里是数字1,不小写字母l
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
vba代码调试解决
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询