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

[µo°Ý] ¨D§U

¦^´_ 4# aa7551
114-1913F1A-VC  ¤]ºâ¦b¦¨«~¶Ü?

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-1-18 23:06 ½s¿è

¦^´_ 11# aa7551
³o¼Ë§PÂ_§A¬Ýµ²ªG²Å¤£²Å¦X
  1. Sub test()
  2. Dim ar, s, ss, d1, d2
  3. Set d1 = CreateObject("scripting.dictionary")
  4. Set d2 = CreateObject("scripting.dictionary")

  5. With Sheets(1)
  6.     ar = .Range(.[a2], .[a2].End(xlDown)).Value
  7.     For Each s In ar
  8.         '¦¨«~
  9.         If s Like "???-????L*" Then
  10.             d1.Item(s) = ""
  11.             ss = Left(s, 8) & "R" & Mid(s, 10)
  12.             If d1.exists(ss) Then d1.Remove (ss)
  13.         End If
  14.         If s Like "???-????R*" Then '«D¦¨¹ï«O¯d
  15.             If Not d1.exists(Left(s, 8) & "L" & Mid(s, 10)) Then d1.Item(s) = ""
  16.         End If
  17.         
  18.         '¹s¥ó
  19.         If s Like "??????-????L*" Then
  20.             d2.Item(s) = ""
  21.             ss = Left(s, 11) & "R" & Mid(s, 13)
  22.             If d2.exists(ss) Then d2.Remove (ss)
  23.         End If
  24.         If s Like "??????-????R*" Then '«D¦¨¹ï«O¯d
  25.             If Not d2.exists(Left(s, 11) & "L" & Mid(s, 13)) Then d2.Item(s) = ""
  26.         End If
  27.     Next
  28.     .[k2].Resize(d1.Count) = Application.Transpose(d1.keys)
  29.     .[n2].Resize(d2.Count) = Application.Transpose(d2.keys)
  30. End With
  31. Set d1 = Nothing: Set d2 = Nothing
  32. End Sub
½Æ»s¥N½X

TOP

¦^´_ 18# aa7551
  1. Sub test()
  2. Dim ar, s5s6, s8s9, s, d1, d2
  3. Set d1 = CreateObject("scripting.dictionary")
  4. Set d2 = CreateObject("scripting.dictionary")

  5. With Sheets(1)
  6.     ar = .Range(.[a2], .[a2].End(xlDown)).Value
  7.     For Each s In ar
  8.         s5s6 = Mid(s, 5, 2)
  9.         If Mid(s, 4, 1) = "-" And (s5s6 = "11" Or s5s6 = "17" Or s5s6 = "20" Or s5s6 = "25" Or s5s6 = "37") Then d1.Item(s) = ""
  10.             
  11.         s8s9 = Mid(s, 8, 2)
  12.         If Mid(s, 7, 1) = "-" And (s8s9 = "11" Or s8s9 = "20") Then d2.Item(s) = ""
  13.     Next
  14.     For Each s In d1.keys
  15.         If Mid(s, 9, 1) = "R" And d1.exists(Left(s, 8) & "L" & Mid(s, 10)) Then
  16.             d1.Remove (s)
  17.         End If
  18.     Next
  19.     For Each s In d2.keys
  20.         If Mid(s, 12, 1) = "R" And d2.exists(Left(s, 11) & "L" & Mid(s, 13)) Then
  21.             d2.Remove (s)
  22.         End If
  23.     Next
  24.    
  25.     .[k2].Resize(d1.Count) = Application.Transpose(d1.keys)
  26.     .[n2].Resize(d2.Count) = Application.Transpose(d2.keys)
  27. End With
  28. Set d1 = Nothing: Set d2 = Nothing
  29. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³¤ß´N¦³ºÖ¡A¦³Ä@´N¦³¤O¡A¦Û³yºÖ¥Ð¡A¦Û±oºÖ½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD