vba中查找下一个 '不能取得 rang 的findnext属性是怎么回事?
PublicSubFindMe(strToFindAsString)DimrngCAsRange'对象DimFirstAddressAsString'起始位置Dimint...
Public Sub FindMe(strToFind As String)
Dim rngC As Range '对象
Dim FirstAddress As String '起始位置
Dim intS As Integer '保存位置
Dim wSht As Worksheet
Application.ScreenUpdating = False '关闭刷新
intS = 1
With xlsheet.UsedRange '' 选择表销售汇总表中的使用范围
Set rngC = .Find(what:=strToFind, LookAt:=xlWhole) 'XlLookAt 常量之一:xlPartXlLookAt 常量之一:xlPart (是部分匹配 )或 xlWhole(是完全匹配)。
If Not rngC Is Nothing Then
FirstAddress = rngC.Address
Do
rngC.EntireRow.Delete Shift:=xlUp
intS = intS + 1
Set rngC = .FindNext(rngC) '查找下一个 '不能取得 rang 的findnext属性是怎么回事????
Loop While Not rngC Is Nothing And rngC.Address <> FirstAddress
End If
End With
Application.ScreenUpdating = True '开启刷新
End Sub 展开
Dim rngC As Range '对象
Dim FirstAddress As String '起始位置
Dim intS As Integer '保存位置
Dim wSht As Worksheet
Application.ScreenUpdating = False '关闭刷新
intS = 1
With xlsheet.UsedRange '' 选择表销售汇总表中的使用范围
Set rngC = .Find(what:=strToFind, LookAt:=xlWhole) 'XlLookAt 常量之一:xlPartXlLookAt 常量之一:xlPart (是部分匹配 )或 xlWhole(是完全匹配)。
If Not rngC Is Nothing Then
FirstAddress = rngC.Address
Do
rngC.EntireRow.Delete Shift:=xlUp
intS = intS + 1
Set rngC = .FindNext(rngC) '查找下一个 '不能取得 rang 的findnext属性是怎么回事????
Loop While Not rngC Is Nothing And rngC.Address <> FirstAddress
End If
End With
Application.ScreenUpdating = True '开启刷新
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询