參考
Public Sub 選股()
Dim I As Integer
Sheets("賣超選股").Select
[b3:c53] = ""
For Z = 3 To 52
Cells(Z, 2).Value = Val(Cells(Z, 1).Value)
Next
For I = 3 To 52
Sheets("主力進出").Select
Range("A2").Value = Sheets("賣超選股").Cells(I, 2).Value
[主力進出!A5].QueryTable.Refresh BackgroundQuery:=False
Sheets("卷商").Select
For a = 2 To 28
Cells(a, 2).Select
ActiveCell.FormulaR1C1 = "=IFERROR(MATCH(RC[-1],主力進出!C[5],0),"""")"
Next a
Sheets("賣超選股").Select
Cells(I, 3).Select
ActiveCell.FormulaR1C1 = "=COUNT(卷商!C[-1])"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next
End Sub作者: kekl 時間: 2013-8-25 13:42