|
楼主 |
发表于 2009-10-22 16:30
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
原帖由 blazetwf 于 2009-10-22 15:53 发表
仿照FIND的HELP文档写的。
Dim rng As Range, i As Long, r As Long
Sub test()
With ActiveSheet.Range("A:A")
Set rr = .Find("aa")
If Not rr Is Nothing Then
firstAddress = rr.Address
D ...
谢谢,回复
rng.Copy [e11] --[e11]是什么意思。
Dim rng As Range, i As Long, r As Long
Sub test()
With ActiveSheet.Range("A:A")
Set rr = .Find("aa")
If Not rr Is Nothing Then
firstAddress = rr.Address
Do
If rng Is Nothing Then
Set rng = Range("A" & rr.Row & ":" & "B" & rr.Row)
Else: Set rng = Union(rng, Range("A" & rr.Row & ":" & "B" & rr.Row))
End If
Set rr = .FindNext(rr)
Loop While Not rr Is Nothing And rr.Address <> firstAddress
rng.Copy [e11]
For Each rrr In rng
rrr.Interior.ColorIndex = 34
Next
End If
End With
End Sub
rrr.Interior.ColorIndex = 34
只能用循环变色吗?? |
|