Results 1 to 6 of 6

Want to have this macro take the Active Cell and Offset cells to create folder using those

Threaded View

myerays Want to have this macro take... 08-09-2021, 09:22 PM
Artik Re: Want to have this macro... 08-09-2021, 11:00 PM
myerays Re: Want to have this macro... 08-10-2021, 09:02 PM
Sintek Re: Want to have this macro... 08-10-2021, 04:24 AM
myerays Re: Want to have this macro... 08-10-2021, 08:52 PM
Sintek Re: Want to have this macro... 08-11-2021, 02:59 AM
  1. #1
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Want to have this macro take the Active Cell and Offset cells to create folder using those

    I want to be able to select and cell in a column and have the macro use that cell value and offset values to create folder and folders inside that folder.

    should look like this folder name "2021-07-26 - 000717171717Z01 - william - bike"
    This would be inside "MyWork" folder.


    Sub CreateMyFolderMy()
     
      Dim MyFile4 As String
      Dim dDir4 As String
      Dim dDir6 As String
      Dim dDir7 As String
      Dim fdObj As Object
        
        MyFile4 = ActiveCell.Value & " - " & ActiveCell.Offset(columnOffset:=3) & " - " & ActiveCell.Offset(columnOffset:=4) & " - " & ActiveCell.Offset(columnOffset:=5)
        sDir4 = _
     "C:\Users\" & Environ("username") & "\Desktop\MyWork\" & MyFile4
    
        dDir4 = _
     "C:\Users\" & Environ("username") & "\Desktop\MyWork\" & MyFile4 & "\Images"
    
       dDir6 = _
     "C:\Users\" & Environ("username") & "\Desktop\MyWork\" & MyFile4 & "\Sentery Pak"
    
       dDir7 = _
     "C:\Users\" & Environ("username") & "\Desktop\MyWork\" & MyFile4 & "\Race Files"
    
        
        Application.ScreenUpdating = False
        Set fdObj = CreateObject("Scripting.FileSystemObject")
        If fdObj.FolderExists("C:\Users\" & Environ("username") & "\Desktop\MyWork") Then
        MkDir sDir4
        MkDir dDir4
        MkDir dDir6
        MkDir dDir7
            MsgBox "Click on Open MyWork Button to view Folder To Open Folder.", vbInformation, "My Folder Creater"
        Else
            fdObj.CreateFolder ("C:\Users\" & Environ("username") & "\Desktop\MyWork")
            MsgBox "MyWork Folder has been created and is on your Desktop.", vbInformation, "My Folder Creater"
        MkDir sDir4
        MkDir dDir4
        MkDir dDir6
        MkDir dDir7
        End If
        Application.ScreenUpdating = True
        
    End Sub
    Attached Files Attached Files
    Last edited by myerays; 08-09-2021 at 09:23 PM. Reason: added new text

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using offset function to select a range of cells based on active cell location
    By laxminarayana in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-25-2017, 07:49 AM
  2. [SOLVED] Create new folder using active sheet's name
    By Raphaelp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2017, 05:48 PM
  3. [SOLVED] Create macro to wrap text for active cell
    By Triscia in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-15-2016, 07:39 PM
  4. Replies: 1
    Last Post: 09-22-2015, 02:22 PM
  5. Macro To Open Folder From Active Cell
    By Jason Carlos in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2015, 05:53 PM
  6. Excel macro to create a new folder and saveas active workbook
    By Rachela123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2014, 11:27 AM
  7. [SOLVED] VB Macro To Take Highlighted Cells & Create Folder name from it.
    By aelingil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2013, 01:24 PM

Tags for this Thread

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