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