Create Multiple Folders Based on Cell Value Using Excel VBA and Batch File

Опубликовано: 01 Октябрь 2024
на канале: The World Of Algorithms
184
like

💡 Source Code

Sub CreateMultipleFolders_CMD()
Dim fso As New FileSystemObject, path As String, lr As Integer, i As Integer

path = "C:\Users\User\Desktop\Mortal_Kombat\"

lr = Cells(Rows.Count, 1).End(XlDirection.xlUp).Row
fso.CreateTextFile (path + "MK.bat")
Open path + "MK.bat" For Output As #1

For i = 1 To lr
Print #1, "md " + path + ChrW(34) + Cells(i, 1).Value + ChrW(34)
Next i

MsgBox "Done", vbInformation + vbOKOnly, ""

End Sub

------------------------------------------------------------------------------------------
Buy a Cofee ☕ for theworldofalgorithms: https://ko-fi.com/theworldofalgorithms

🥰Thank you for the donation. I am deeply grateful for your help!🥰
------------------------------------------------------------------------------------------

#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
#folder
#createfolder
#createmultiplefolders
#multiplefolders
#batchfile
#commandprompt
#cmd
#createbatchfile
#batextension