+ Reply to Thread
Results 1 to 23 of 23

MkDir with cell value as folder name.

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    MkDir with cell value as folder name.

    Hi all i need urgent help creating folders with the cell value as folder name.

    I tried but did not sucseed, the folders needs to be created in a folder on my desctop.
    Thanks


    The File with the data is attached.

    FR Catai Assets Final 23-08-2012.xlsm

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,517

    Re: MkDir with cell value as folder name.

    Try this

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,286

    Re: MkDir with cell value as folder name.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    With the first one i recive the following error.

    What did i do wrong?
    Error.xlsx

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,517

    Re: MkDir with cell value as folder name.

    Need to change C:\to your desktop path. Or use Bobs that will get your desktop path for you.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    Fixed
    Thanks

  7. #7
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    I now need to go a step futher, i need a folder for each month in each folder.

    At the moment my macro is like this:

    Please Login or Register  to view this content.
    How do I need to change it now?

    Thanks for the help!

    FR Catai Assets Final 23-08-2012.xlsm
    Last edited by Cutter; 08-23-2012 at 12:46 PM. Reason: Added code tags

  8. #8
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,286

    Re: MkDir with cell value as folder name.

    Where does C:\test align to your request for the desktop?

  9. #9
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    I just made a folder on my c drive, sorry.

  10. #10
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,286

    Re: MkDir with cell value as folder name.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    Nothing happens, the macro run with no error,but nothing happens?
    Last edited by Cutter; 08-23-2012 at 12:47 PM. Reason: Removed whole post quote

  12. #12
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,286

    Re: MkDir with cell value as folder name.

    Is this any better?

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    Sorry but where will make the folders, as the test folder is still empty?
    Last edited by Cutter; 08-23-2012 at 12:47 PM. Reason: Removed whole post quote

  14. #14
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    My macro looks like this.
    Please Login or Register  to view this content.
    Last edited by Cutter; 08-23-2012 at 12:48 PM. Reason: Added code tags

  15. #15
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    Can anybody help me?

  16. #16
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: MkDir with cell value as folder name.

    @ tdo4h

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

    Also
    Please notice that I have removed whole post quotes from your posts(s). Please read the following forum rule and keep it in mind for your future posts. Thanks.

    Rule 12. Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.

  17. #17
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    Please Any body, i need this to work.
    Thanks

  18. #18
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,286

    Re: MkDir with cell value as folder name.

    Presumably there is an error. Remove the line that says On Error Resume Next and tell us where it errors and what the error is. Get the value of path as well, and your desktop folder.

  19. #19
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    The Macro run with out any error, it but it did not create any folders?
    Thanks

    ---------- Post added at 10:39 AM ---------- Previous post was at 10:38 AM ----------

    The macro that Mike posted worked, now i just need to make folders in the folder, a folder per month.
    Thanks

  20. #20
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,286

    Re: MkDir with cell value as folder name.

    I know that, but there is an error ignore statement, which is what I suggested that you remove and re-run.

  21. #21
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    Thanks, the error that I recive is :Run-time error '76' Path not found

    Please be patient with me, as I am new to this, and not used to the forum rule's, but will do my best to obey them.
    Thanks.

  22. #22
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,286

    Re: MkDir with cell value as folder name.

    I am being patient, trust me

    What was the value of path when the error arose, and what is the full value of your desktop folder (e.g. mine is C:\Users\bob\Desktop)?

  23. #23
    Registered User
    Join Date
    08-06-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: MkDir with cell value as folder name.

    MkDir path & cell2.Value & "\" & cell.Value
    My full value is C:\User\Sarel Snyman\Desktop.

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1