|
参与一下。。。
- Sub ykcbf() '//2024.11.6
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- arr = Sheets("每日最高(公)").UsedRange
- For i = 2 To UBound(arr)
- s = arr(i, 2)
- For j = 25 To UBound(arr, 2)
- If Not d.exists(s) Then
- d(s) = Array(arr(i, j), arr(1, j))
- Else
- t = d(s)
- t(0) = IIf(t(0) > arr(i, j), t(0), arr(i, j))
- t(1) = IIf(t(0) > arr(i, j), t(1), arr(1, j))
- d(s) = t
- End If
- Next
- Next
- arr = Sheets("每日最低(公)").UsedRange
- For i = 2 To UBound(arr)
- s = arr(i, 2)
- For j = 27 To UBound(arr, 2)
- If Not d1.exists(s) Then
- d1(s) = Array(arr(i, j), arr(1, j))
- Else
- t = d1(s)
- t(0) = IIf(t(0) < arr(i, j), t(0), arr(i, j))
- t(1) = IIf(t(0) < arr(i, j), t(1), arr(1, j))
- d1(s) = t
- End If
- Next
- Next
- With Sheets("1判每日取数判断(公)")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 14)
- For i = 2 To UBound(arr)
- s = arr(i, 2)
- If d.exists(s) Then
- arr(i, 11) = d(s)(0)
- arr(i, 12) = d(s)(1)
- arr(i, 13) = d1(s)(0)
- arr(i, 14) = d1(s)(1)
- End If
- Next
- .[a1].Resize(r, 14) = arr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|