fork download
  1. Option Explicit
  2. Public Sub 不要物削除()
  3. Dim i As Long
  4. Dim RE As Object
  5. Dim str As String
  6. Dim matches As Object
  7. Dim submatch As Object
  8. Set RE = CreateObject("VBScript.RegExp")
  9. RE.Pattern = "^(\d+-\d+).*$"
  10. RE.Global = True
  11. For i = 1 To 4000
  12. str = Cells(i, "B").Value
  13. If str <> "" Then
  14. Set matches = RE.Execute(str)
  15. If matches.Count > 0 Then
  16. Set submatch = matches.Item(0).submatches
  17. Cells(i, "A").Value = submatch(0)
  18. End If
  19. End If
  20. Next
  21. End Sub
  22.  
  23.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty