💡 Source Code
'Microsoft Scripting Runtime - Don't forget to activate this library
Public Const p As String = "Directory\TxtFilePassword.txt"
Public Function Generate_Random_Len_Password()
Application.Volatile (-1)
Dim r As Byte, res As String, r_len As Byte, pwd As Byte
r_len = WorksheetFunction.RandBetween(8, 15)
For pwd = 1 To r_len
r = WorksheetFunction.RandBetween(0, 1)
If r = 0 Then
res = res & WorksheetFunction.RandBetween(0, 9)
Else:
r = WorksheetFunction.RandBetween(0, 1)
If r = 0 Then
res = res & ChrW(WorksheetFunction.RandBetween(65, 90))
Else:
res = res & ChrW(WorksheetFunction.RandBetween(97, 122))
End If
End If
Next pwd
Generate_Random_Len_Password = res
End Function
Sub SendToTxtFile()
Dim fso As New FileSystemObject, i As Byte, t1 As String, t2 As String, t3 As String
t1 = " ***** Like the video"
t2 = " ***** Subscribe to the channel"
t3 = " ***** Share the video so that more people are aware of the video"
'If Not fso.FileExists(p) Then fso.CreateTextFile (p) ' Bu olanda eyni melumat tekrar-tekrar yazilir
If Not fso.FolderExists(p) Then fso.CreateTextFile (p) 'Bu olanda melumatlar 1-1-nin ustune yazilir
Open p For Append As #1
Print #1, "The World of Algorithms"
Print #1, vbNewLine & t1 & vbNewLine & t2 & vbNewLine & t3
Print #1, ""
For i = 1 To 100
Print #1, "Password " & i & " : " & Generate_Random_Len_Password()
Next i
Print #1, ""
Print #1, "All Rights Reserved 2022 Copyright!"
Close #1
End Sub
Sub GetFromTxtFile()
Dim gf_i As Integer, textline As String
Cells.Clear
Open p For Input As #1
gf_i = 1
Do
Line Input #1, textline
Cells(gf_i, 1) = textline
gf_i = gf_i + 1
Loop While Not EOF(1)
Close #1
End Sub
------------------------------------------------------------------------------------------
#excel
#msexcel
#msexceltutorial
#msexcelcourse
#vba
#vbatutorial
#excelvba
#fulltutorial
#excelvbatutorial
#microsoftexceltutorial
#tutorial
#exceltutorial
#advancedexcel
#advancedexceltraining
#tutor
#exceltutor
#exceltutoring
#exceltutoringonline
#onlineexceltutoring
#algorithm
#algorithms
#programming
#program
#script
#vbamacro
#vbamacros
#usingmacro
#veryuseful
#useful
#veryusefulmacro
#freeeducation
#freeprogramming
#freelancer
#excelfreelancer
#vbafreelancer
#freelanceservices
#module
#vbamodule
#microsoftscriptingruntime
#scrrun
#dll
#runtime
#object
#earlybinding
#fso
#filesystem
#filesystemobject
#vbafilesystemobject
#vbafolderexists
#vbafilerexists
#textfile
#append
#createtextfile
#openforoutput
#vbaopenforoutput
#randbetween
#excelrandbetween