|
楼主 |
发表于 2009-10-22 12:52
|
显示全部楼层
有人要的,帮做个试试
VB里代码
Sub wu()
Dim EL As Object, odic As Object, hang As Object
Set EL = GetObject(, "Excel.Application")
Set odic = CreateObject("scripting.dictionary")
Set hang = EL.ActiveSheet.UsedRange
With EL.ActiveSheet
.Range("d:d") = ""
For i = 1 To hang.Rows.Count
If .cells(i, 1) > 30 Then
odic(CStr(.cells(i, 1))) = i
End If
Next
If i > 0 Then
.Range("d1:d" & odic.Count) = EL.WorksheetFunction.Transpose(odic.keys)
End If
End With
Set hang = Nothing
Set odic = Nothing
Set EL = Nothing
End Sub |
|