+ Reply to Thread
Results 1 to 3 of 3

Excel Document that creates new excel documents monthly

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-27-2022
    Location
    MS, USA
    MS-Off Ver
    Microsoft 365
    Posts
    149

    Excel Document that creates new excel documents monthly

    Hi,

    I was trying to make an excel document that creates a new copy of document templates I have monthly. I have three attachments:
    The first one (Monthly File Reset) has a few formulas to dictate how the file name should be written and the other two are more or less blank templates for reference for the process.

    What I have envisioned.
    - Cells B1 & C1 = are the now() function and will change month to month and year to year, respectively.
    - A5 & A6 = Are the Filenames
    - A12 & A13 are concatenate formulas of Filenames, b1 & c1

    I am seeking to have a formula that when opened, looks at a folder location, and sees if the concatenate string name exist.
    If it does exist, then nothing Else create a copy of the template and name it the concatenate string in that cell.

    Thank you in advance for any help and please respond with questions if I didn't make something clear enough.

    (My apologies I posted in General and not in Excel Programming / VBA / Macros)
    Attached Files Attached Files
    Last edited by Ajaxs87; 07-16-2022 at 05:04 PM.

  2. #2
    Forum Contributor
    Join Date
    03-27-2022
    Location
    MS, USA
    MS-Off Ver
    Microsoft 365
    Posts
    149

    Re: Excel Document that creates new excel documents monthly

    Here is the vba I kind of have in mind, but I guess I need to loop it and I am not sure exactly have loops. Any feedback would be appreciated. Thank you for either reading or helping.

    Sub GetFileNames()
    Dim FileName As String
    Set soms = ThisWorkbook.Worksheets("sheet1").Range("a12")
    
    FileName = Dir("C:\" & soms & ".xlsx")
    
    If FileName = "" Then
    
    FileCopy "C:\Signal App Reporting Template.xlsx", "C:\" & soms & ".xlsx"
    
    Else
    
    
    MsgBox "File exist"
    
    
    
    End If
    
    End Sub
    Last edited by Ajaxs87; 07-15-2022 at 07:17 PM.

  3. #3
    Forum Contributor
    Join Date
    03-27-2022
    Location
    MS, USA
    MS-Off Ver
    Microsoft 365
    Posts
    149

    Re: Excel Document that creates new excel documents monthly

    I figured it out.

    I redid my setup for the page so its easier to edit for me down the road. So the VBA code below is related to the attachment to this post.
    Sub Loopy()
    
    For i = 2 To 3
    
    
    FileName = Dir(Cells(i, 5))
    
    
    
    
    If FileName = "" Then
    
    FileCopy Cells(i, 3), Cells(i, 5)
    
    Else
    MsgBox Cells(i, 5) & "Already Exist"
    
    
    End If
    
    Next i
    
    
    End Sub
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Opening a Word document from Excel file creates (hidden?) copies of excel files
    By frankt68 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-04-2022, 10:32 PM
  2. [SOLVED] Reading document properties for Excel and Word documents
    By Un-Do Re-Do in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-31-2018, 04:16 AM
  3. Excel database creates a Word document from a template based on excel data
    By llamafarmer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2017, 09:21 AM
  4. [SOLVED] Code help: Selecting documents into one Word document via Excel
    By jk. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2015, 12:21 PM
  5. Replies: 1
    Last Post: 10-10-2013, 10:53 AM
  6. Using Excel to merge 2 or more PDF documents Into 1 PDF Document
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-11-2011, 03:34 PM
  7. [SOLVED] email excel document with hyperlinks to mutliple documents
    By angiey in forum Excel General
    Replies: 3
    Last Post: 08-03-2006, 10:40 AM

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