making a folder with vba

Jake975

Board Regular
Joined
Feb 9, 2020
Messages
114
Office Version
  1. 2016
Platform
  1. Windows
VBA Code:
Mkdir (""""C:\Audit Reports\Disembodied" & Format(Date , "mm-dd-yyyy"""")
How can i make a folder that is created and has a date as its name?
I know the current code doesn't work but i'm looking for a way to make it work.
Thanks in advance
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
mkdir "c:\audit reports\disembodied\" & format(date,"YY.MM.DD")

Just a suggestion. Your folders will sort better using YY MM DD. The dot is easier to read in a list than the dash.
Another format that is even better IMO is "YY MM DD". (2 spaces between)
 
Upvote 0
its the way the company wants it. As the employee has to go back in to edit files for the previous day. But i will bring it to their attention to see if they go for it.
thank you for your help
 
Upvote 0
where would i add a "-1" to move the date back one day?
 
Upvote 0
thank you so much it was a long day and my mind wasn't working
 
Upvote 0

Forum statistics

Threads
1,215,634
Messages
6,125,938
Members
449,275
Latest member
jacob_mcbride

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