+ Reply to Thread
Results 1 to 1 of 1

Need help on macro that creates two Workbooks with custom file names

  1. #1
    Registered User
    Join Date
    05-20-2015
    Location
    United States
    MS-Off Ver
    Microsoft Office 2013
    Posts
    36

    Need help on macro that creates two Workbooks with custom file names

    Hello everyone,

    I am in need of some assistance with a Macro I am trying to create for work. Long story short, I need my Macro to create two Workbooks with specific names, and the current days date. (Example_1_MMDDYY and Example_2_MMDDYY). Currently, my Macro creates two Workbooks titled "Book1" and "Book2". If at all possible, I would also like these workbooks automatically saved to a network drive. The only issue I see with that, is the files are saved according to the current month, so the folder is never static. Below is the code I have so far. Any help would be greatly appreciated.

    Sub ET_Test()
    '
    ' ET_Test Macro
    '

    '
    Workbooks.Add
    Workbooks.Add
    Windows("004 Course Flags Live - Sub.xlsx").Activate
    Columns("A:P").Select
    Selection.Copy
    Windows("Book1").Activate
    Columns("A:A").Select
    ActiveSheet.Paste
    Windows("Book2").Activate
    Columns("A:A").Select
    ActiveSheet.Paste
    Range("A6").Select
    Windows("Book1").Activate
    Rows("1:5").Select
    Range("A5").Activate
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlUp
    Columns("J:P").Select
    Selection.Delete Shift:=xlToLeft
    Columns("A:A").Select
    Selection.Delete Shift:=xlToLeft
    Columns("D:D").Select
    Selection.Cut
    Columns("A:A").Select
    Selection.Insert Shift:=xlToRight
    Columns("D:D").Select
    Selection.Cut
    Columns("B:B").Select
    Selection.Insert Shift:=xlToRight
    Columns("G:H").Select
    Selection.Delete Shift:=xlToLeft
    Columns("E:E").Select
    Selection.Copy
    Columns("G:G").Select
    Selection.Insert Shift:=xlToRight
    Range("G1").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "Subscriber Key"
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "Military Branch"
    Columns("C:C").Select
    Selection.Delete Shift:=xlToLeft
    Range("C1").Select
    ActiveCell.FormulaR1C1 = "Semester Start Date"
    Range("C2").Select
    Windows("Book2").Activate
    Rows("1:5").Select
    Range("A5").Activate
    Selection.Delete Shift:=xlUp
    Columns("H:P").Select
    Selection.Delete Shift:=xlToLeft
    Range("G:G,C:C,B:B").Select
    Range("B1").Activate
    Selection.Delete Shift:=xlToLeft
    Cells.Select
    ActiveSheet.Range("$A$1:$P$3153").RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6 _
    , 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), Header:=xlNo
    Range("E1").Select


    Columns("C:C").Select
    Selection.Cut
    Columns("B:B").Select
    Selection.Insert Shift:=xlToRight
    Range("B2").Select



    Windows("Book1").Activate
    Cells.Select
    ActiveSheet.Range("$A$1:$S$3153").RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6 _
    , 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), Header:=xlNo
    Range("G1").Select




    End Sub
    Last edited by joshuarobbins; 05-20-2015 at 07:20 PM. Reason: bump post

+ 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. Urgent!! Macro to copy Data from Excel and creates Pipe Delimitted Txt file.
    By sesgiri in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-29-2014, 10:09 AM
  2. How to repeat macro that creates a text file
    By Rightside_15 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2014, 11:13 AM
  3. Macro to display when a file was last modified and creates a version counter!
    By JamesGoulding85 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2013, 12:06 PM
  4. Save a Macro Enabled Template to a custom location with a custom file name.
    By andcha in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-24-2013, 11:46 AM
  5. [SOLVED] A Macro that creates hyperlinks by matching the names of a column
    By kc07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2012, 04:17 AM

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