|
=INDEX(总表!A:A,SMALL(IF(总表!$F:$F="销售",ROW(总表!$F:$F),65536),ROW(1:1)))&"",见附件,请帮忙用VBA解决,感谢!
改自帮助中的示例程序
Sub test()
Sheets("销售").Select
Rows("2:1000").Clear
r% = 1
With Worksheets("总表")
Set c = .Range("g:g").Find("销售", LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
r = r + 1
.Range("a" & c.Row & ":g" & c.Row).Copy Cells(r, 1)
Set c = .Range("g:g").FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
|
|