Check box to create windows folders

wisemank

Board Regular
Joined
Jun 21, 2010
Messages
129
Hi there again,
I am trying to stabilize a process internally and this in part, is to create specific folders (on a network drive) based on the checked box values from my User Form. Each project we do may or may not need a folder to maintain working files and instead of adding empty folders that may never be used, I want to only add the folders based on the requirement. So if the checked boxes on the User Form declare the value of each folder required then once a button to execute the transaction is pressed then each required (checked box) folder(s) is created. I have reviewed code created based on cells on a worksheet, but I don't want any extra worksheets. Any ideas?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Here is what I have simplistically, but works: please see below

Private Sub CommandButton1_Click()

If CheckBox1.Value = True Then ActiveSheet.Range("H2").Value = "x" & MkDir("c:\folder1")
If CheckBox1.Value = False Then ActiveSheet.Range("H2").Value = ""

If CheckBox2.Value = True Then ActiveSheet.Range("I2").Value = "x" & MkDir("c:\folder2")
If CheckBox2.Value = False Then ActiveSheet.Range("I2").Value = ""

If CheckBox3.Value = True Then ActiveSheet.Range("J2").Value = "x" & MkDir("c:\folder3")
If CheckBox3.Value = False Then ActiveSheet.Range("J2").Value = ""

Unload Me

End Sub


I would like to loop to next empty row to place the "X" in the proper cell reference and then create the root directory from another column cell in the same row...
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top