Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-16-2022, 02:10 AM
ranjan ranjan is offline Folder Creation Windows 10 Folder Creation Office 2019
Advanced Beginner
Folder Creation
 
Join Date: May 2021
Posts: 71
ranjan is on a distinguished road
Default Folder Creation

I want to create a folders based on a excel value.

Folder creation path should be as a browse option.

strPath = InputBox("Enter Files Path") & ""

I had a below code, can anyone modified as per my requirement.

It is creating a folders where a macro excel sheet is exists but i need to change as "choose a folder from a browse option to where i want to create a folders" because every time need to change a location and it is more dynamic.



Please review the below code, your help is highly appreciated.



Code:
Sub MakeFolders()
Dim Rng As Range
Dim maxRows, maxCols, r, c As Integer
Set Rng = Selection
maxRows = Rng.Rows.Count
maxCols = Rng.Columns.Count
For c = 1 To maxCols
r = 1
Do While r <= maxRows
If Len(Dir(ActiveWorkbook.Path & "\" & Rng(r, c), vbDirectory)) = 0 Then
MkDir (ActiveWorkbook.Path & "\" & Rng(r, c))
On Error Resume Next
End If
r = r + 1
Loop
Next c
End Sub
Reply With Quote
Reply

Tags
creation, folders

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
UTF-8 Creation ranjan Word VBA 3 08-28-2021 05:27 PM
Folder Creation Document Creation Caerleon Word 1 09-11-2015 07:42 PM
Folder Creation Template creation Calvinclown Word 3 09-16-2014 07:19 PM
Folder Creation Document Creation Privateer Word 3 06-20-2013 08:15 PM
Report creation. Igtech Excel 1 04-02-2010 03:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft