Results 1 to 4 of 4

Create folder based on cell value

Threaded View

  1. #1
    Registered User
    Join Date
    11-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Create folder based on cell value

    Hi All,

    I have a query. Please find attached sheet. In attached sheet I put a function for today’s date (which is =today()), next to this one command button with name ‘Create Folder’.

    What I want to achieve is, when I click on command button excel create a folder with the cell value in B2 (which is 2day’s date).

    I have written this code but it’s not working.

    Can anyone help me with this?

    Thanks


    Private Sub CommandButton1_Click()

    MakeFolders

    End Sub

    Sub MakeFolders()

    Dim x As String

    With ActiveSheet

    x = .Range("B2").Value

    If x > 0 Then
    MkDir (ActiveWorkbook.Path & "H:\Others\VBA\" & x("B2"))

    End If

    End With

    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Simple: Create folder based on cell value
    By Hooty in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-07-2012, 11:21 AM
  2. Replies: 5
    Last Post: 09-13-2012, 09:49 AM
  3. Replies: 1
    Last Post: 09-12-2012, 11:29 AM
  4. [SOLVED] Create a new folder based on a cell name or value and save copy onto that folder
    By Le_Tiago in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-20-2012, 01:33 PM
  5. Macro to save duplicate file and create folder name based on cell value
    By munkee in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-19-2012, 12:09 PM

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