Advertisement
maxisy

Untitled

Apr 8th, 2022
1,941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2. Type plikwindows
  3.     nazwa As String * 60
  4.     rozszerzenie As String * 10
  5. End Type
  6.  
  7. Sub usun()
  8. Dim row As Integer, cell
  9.  
  10. For row = 3 To 5000
  11.     cell = Cells(row, 1)
  12.     If InStr(cell, "Directory") <> 0 Or Len(cell) <= 3 And Len(cell) >= 1 Or IsNumeric(Left(cell, 1)) Then
  13.         Cells(row, 1) = ""
  14.     End If
  15. Next
  16. End Sub
  17.  
  18. Sub zapisz()
  19. Dim name As String, i As Integer, now As String
  20.  
  21. name = Application.GetSaveAsFilename
  22. Open name For Output As #1
  23.  
  24. For i = 3 To 5000
  25.     now = Cells(i, 1)
  26.     If Not now = "" Then Print #1, now
  27. Next
  28.  
  29. Close #1
  30.  
  31. MsgBox "gotowe"
  32. End Sub
  33.  
  34. Sub zlicz()
  35. Dim row As Integer, cell, dlls As Integer, exes As Integer, op As Integer
  36.  
  37. For row = 3 To 5000
  38.     cell = Cells(row, 1)
  39.     If cell Like "*.dll" Then
  40.         dlls = dlls + 1
  41.     ElseIf cell Like "*.exe" Then
  42.         exes = exes + 1
  43.     ElseIf cell Like "?o*.??p*" Then
  44.         op = op + 1
  45.     End If
  46. Next
  47.  
  48. Cells(3, 3) = dlls
  49. Cells(3, 4) = exes
  50. Cells(3, 5) = op
  51. End Sub
  52.  
  53. Sub zapisz_dostep_swobodny()
  54. Dim name As String, i As Integer, pliki As plikwindows, cell, row As Integer, leng As Integer, rozszerzenie As String
  55.  
  56. name = Application.GetSaveAsFilename
  57. i = 1
  58.  
  59. Open name For Random As #1 Len = Len(pliki)
  60.     For row = 3 To 5000
  61.         cell = Cells(row, 1)
  62.         If cell <> "" And InStr(cell, ".") <> 0 Then
  63.             If InStr(cell, "\") = 0 Then
  64.             rozszerzenie = Right(cell, InStr(StrReverse(cell), "."))
  65.                 If rozszerzenie = ".exe" Or rozszerzenie = ".ini" Or rozszerzenie = ".xml" Or rozszerzenie = ".JSON" Or rozszerzenie = ".bin" Or rozszerzenie = ".txt" Or rozszerzenie = ".dll" Or rozszerzenie = ".log" Or rozszerzenie = ".prx" Or rozszerzenie = ".ecf" Or rozszerzenie = ".cab" Or rozszerzenie = ".hve" Or rozszerzenie = ".png" Or rozszerzenie = ".sdb" Or rozszerzenie = ".mui" Or rozszerzenie = ".nlp" Or rozszerzenie = ".config" Or rozszerzenie = ".resources" Then
  66.                     With pliki
  67.                         .nazwa = Left(cell, Len(cell) - InStr(StrReverse(cell), "."))
  68.                         .rozszerzenie = rozszerzenie
  69.                     End With
  70.                     Put #1, i, pliki
  71.                     i = i + 1
  72.                 End If
  73.             End If
  74.         End If
  75.     Next
  76. Close #1
  77.  
  78. MsgBox "gotowe"
  79. End Sub
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement