ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¤j¶q¸ê®Æ¾ã²z

¥»©«³Ì«á¥Ñ singo1232001 ©ó 2022-6-3 18:24 ½s¿è

¦^´_ 1# oak0723-1

Sub ¤ñ¹ïdb()
T = Timer
Set s = Sheets("¤ñ¹ï")
rw = s.Cells(Rows.Count, "i").End(3).Row
  If rw <= 5 Then rw = 5
   s.Range("h5:in" & rw).ClearContents
    ar = s.[I3:IN5]
   
br = Sheets("¸ê®Æ®w").Range("H5:IN" & Sheets("¸ê®Æ®w").Cells(Rows.Count, "i").End(3).Row)
For i = 1 To UBound(br): br(i, 1) = 0: Next
  For i = 1 To UBound(br, 2): br(1, i) = 0: Next
      
For i = 1 To UBound(ar, 2)
k = i + 1
  If ar(1, i) <> "" Or ar(2, i) <> "" Then
      For j = 2 To UBound(br)
        If ar(1, i) <= br(j, k) Then
         If br(j, k) <= ar(2, i) Then
          br(1, k) = br(1, k) + 1
           br(j, 1) = br(j, 1) + 1
            br(j, k) = 1
         Else
          br(j, k) = 0
         End If
        Else
          br(j, k) = 0
        End If
      Next
  Else
    For j = 2 To UBound(br): br(j, k) = "": Next
  End If
Next

br(1, 1) = "¦X­p"
s.[h5].Resize(UBound(br), UBound(ar, 2) + 1) = br
  MsgBox Format(Timer - T, "0.0") & "¬í"
End Sub


Àu¤Æ¹L ©È§A¶q¹L¤j

TOP

Sub ¤ñ¹ï()
Dim Brr() As Variant
Dim Arr() As Variant
Dim Crr()
Tm = Timer
Brr = Worksheets("¤ñ¹ï").Range("I3:IN4").Value
Arr = Worksheets("¸ê®Æ®w").[I6:IN6].Value
ReDim Crr(1 To UBound(Arr, 2), 1 To 1)
n = 1
For Each s In Arr
    If s >= Brr(1, n) And s <= Brr(2, n) Then
        Crr(n, 1) = 1
    ElseIf Brr(1, n) = "" Or Brr(2, n) = "" Then
        Crr(n, 1) = ""
    Else
        Crr(n, 1) = 0
    End If
    n = n + 1
Next
MsgBox Timer - Tm
End Sub

TOP

¦^´_ 1# oak0723-1

­É¥Î§Aªº­ì¨Ó¼gªºµ{¦¡¤p­×§ï¤@¤U¦p¤U¡A½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ

Sub test()
Dim Arr, Drr, Brr(), Crr(), T, XMax, XMin, R%, C%, i&
Tm = Timer
With Sheets("¸ê®Æ®w")
    R = .[b6].End(4).Row
    C = .Cells(5, Columns.Count).End(1).Column
    Arr = .Range(.[b6], .Cells(R, 2))
    Drr = .Range(.[i6], .Cells(R, C))
End With
With Sheets("¤ñ¹ï")
    .[b6].Resize(UBound(Arr)) = Arr
    ReDim Brr(1 To UBound(Arr), 1 To UBound(Drr, 2))
    ReDim Crr(1 To UBound(Arr), 1 To 1)
    C = .Cells(3, Columns.Count).End(1).Column
    Arr = .Range(.[i3], .Cells(4, C))
    For i = 1 To UBound(Drr)
        For j = 1 To UBound(Arr, 2)
            T = Drr(i, j): XMin = Arr(1, j): XMax = Arr(2, j)
            If XMin = "" Or XMax = "" Then Brr(i, j) = "": GoTo 99
            If T < XMin Or T > XMax Then
                Brr(i, j) = 0
            ElseIf T >= XMin Or T <= XMax Then
                 Brr(i, j) = 1: Crr(i, 1) = Crr(i, 1) + 1
            End If
99:     Next j
    Next i
    .Range("h6").Resize(UBound(Crr)) = Crr
    .Range("i6").Resize(UBound(Brr), UBound(Brr, 2)) = Brr
End With
MsgBox Timer - Tm
End Sub

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD