|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub Macro1()
- Dim c As Range, r As Range, firstAddress$, i&, m&
- m = [a65536].End(xlUp).Row + 1
- With Range("a:a")
- Set c = .Find("aaaaa", Cells(Rows.Count, 1), , 1)
- If Not c Is Nothing Then
- firstAddress = c.Address
- Do
- i = i + 1
- Set r = c.Offset(1).Resize(m).Find("aaaaa", , , 1)
- If Not r Is Nothing Then
- c.Resize(r.Row - c.Row).Copy Cells(1, i + 13)
- Else
- c.Resize(m - c.Row).Copy Cells(1, i + 13)
- End If
- Set c = .FindNext(c)
- Loop While Not c Is Nothing And c.Address <> firstAddress
- End If
- End With
- End Sub
- 从论坛里面看来的一段代码,请教大家一个问题,.Find("aaaaa", Cells(Rows.Count, 1), , 1)方法里面what:="aaaaa",after:=Cells(Rows.Count, 1),lookin省略,lookat:=1,1具体代表哪个参数,是xlwhole还是xlpart?? 参数顺序是不是这样的?
|
|