| ©«¤l1018 ¥DÃD15 ºëµØ0 ¿n¤À1058 ÂI¦W0  §@·~¨t²Îwin7 32bit ³nÅ骩¥»Office 2016 64-bit ¾\ŪÅv50 ©Ê§O¨k ¨Ó¦Û®ç¶é µù¥U®É¶¡2012-5-9 ³Ì«áµn¿ý2022-9-28 
 | 
                
| ¦^´_ 1# ii31sakura ½Æ»s¥N½XSub Test()
  Dim r As Long, sCond As String
  Dim d, sSN As String, sType As String, max, maxType
  
  Set d = CreateObject("scripting.dictionary")
  
  With Sheets("Data")
    sCond = .[G1].Text
    r = .Cells(.Rows.count, "A").End(xlUp).Row - 1
    If r <= 0 Then Exit Sub
    For Each s In .[A2].Resize(r).Value
      sSN = Split(s, "-")(0)
      sType = Split(s, "-")(1)
      If sSN = sCond Then
        d(s) = d(s) + 1
        If d(s) > max Then max = d(s): maxType = sType
      End If
    Next
    
    .[J1].Value = maxType
    .[J2].Value = max
  End With
  
End Sub
 | 
 |