|
- Sub test()
- Dim r%, i%
- Dim arr, brr()
- With Worksheets("sheet1")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- arr = .Range("a1:a" & r)
- For i = 1 To UBound(arr)
- If arr(i, 1) = "五、各艺术品前十大持有人" Then
- m = m + 1
- ReDim Preserve brr(1 To 2, 1 To m)
- brr(1, m) = i
- brr(2, m) = i
- ElseIf arr(i, 1) = "天津文化艺术品交易所月报" Then
- brr(2, m) = i
- End If
- Next
- For k = 1 To UBound(brr, 2)
- wjm = CStr(k)
- On Error Resume Next
- Set ws = Worksheets(wjm)
- If Err Then
- Set ws = Worksheets.Add(Worksheets(Worksheets.Count))
- ws.Name = wjm
- End If
- With Worksheets(wjm)
- Worksheets("sheet1").Rows(brr(1, k) & ":" & brr(2, k)).Copy .Range("a1")
- End With
- Next
- End With
- End Sub
复制代码 |
|