Results 1 to 66 of 66

Need VBA to create new Workbook and name it based on cell value in original file

Threaded View

YukonSoDank Need VBA to create new... 04-07-2019, 03:40 PM
Mumps1 Re: Need VBA to create new... 04-07-2019, 04:09 PM
YukonSoDank Re: Need VBA to create new... 04-07-2019, 04:21 PM
YukonSoDank Re: Need VBA to create new... 04-07-2019, 04:36 PM
Mumps1 Re: Need VBA to create new... 04-07-2019, 04:44 PM
YukonSoDank Re: Need VBA to create new... 04-07-2019, 05:01 PM
Mumps1 Re: Need VBA to create new... 04-09-2019, 09:28 AM
YukonSoDank Re: Need VBA to create new... 04-09-2019, 12:30 PM
Mumps1 Re: Need VBA to create new... 04-09-2019, 12:38 PM
YukonSoDank Re: Need VBA to create new... 04-09-2019, 01:03 PM
Mumps1 Re: Need VBA to create new... 04-09-2019, 01:07 PM
YukonSoDank Re: Need VBA to create new... 04-09-2019, 02:32 PM
YukonSoDank Re: Need VBA to create new... 04-09-2019, 07:54 PM
Mumps1 Re: Need VBA to create new... 04-10-2019, 10:32 AM
YukonSoDank Re: Need VBA to create new... 04-13-2019, 11:28 AM
Mumps1 Re: Need VBA to create new... 04-13-2019, 03:10 PM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 07:37 AM
Mumps1 Re: Need VBA to create new... 05-08-2019, 09:12 AM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 09:29 AM
Mumps1 Re: Need VBA to create new... 05-08-2019, 09:56 AM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 10:07 AM
Mumps1 Re: Need VBA to create new... 05-08-2019, 10:16 AM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 10:23 AM
Mumps1 Re: Need VBA to create new... 05-08-2019, 10:32 AM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 01:09 PM
Mumps1 Re: Need VBA to create new... 05-08-2019, 03:10 PM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 03:13 PM
Mumps1 Re: Need VBA to create new... 05-08-2019, 03:20 PM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 08:31 PM
Mumps1 Re: Need VBA to create new... 05-09-2019, 08:13 AM
YukonSoDank Re: Need VBA to create new... 05-09-2019, 11:24 AM
Mumps1 Re: Need VBA to create new... 05-09-2019, 11:35 AM
YukonSoDank Re: Need VBA to create new... 05-09-2019, 08:59 PM
Mumps1 Re: Need VBA to create new... 05-10-2019, 08:32 AM
YukonSoDank Re: Need VBA to create new... 05-10-2019, 09:13 AM
Mumps1 Re: Need VBA to create new... 05-10-2019, 01:22 PM
YukonSoDank Re: Need VBA to create new... 05-13-2019, 07:25 PM
Mumps1 Re: Need VBA to create new... 05-14-2019, 10:11 AM
YukonSoDank Re: Need VBA to create new... 05-14-2019, 09:13 PM
Mumps1 Re: Need VBA to create new... 05-15-2019, 11:07 AM
YukonSoDank Re: Need VBA to create new... 05-30-2019, 10:24 AM
Mumps1 Re: Need VBA to create new... 05-30-2019, 11:43 AM
YukonSoDank Re: Need VBA to create new... 05-30-2019, 12:34 PM
Mumps1 Re: Need VBA to create new... 05-30-2019, 01:06 PM
YukonSoDank Re: Need VBA to create new... 05-30-2019, 01:44 PM
Mumps1 Re: Need VBA to create new... 05-31-2019, 09:37 AM
YukonSoDank Re: Need VBA to create new... 05-31-2019, 09:45 AM
Mumps1 Re: Need VBA to create new... 05-31-2019, 11:39 AM
YukonSoDank Re: Need VBA to create new... 05-31-2019, 01:15 PM
Mumps1 Re: Need VBA to create new... 05-31-2019, 02:25 PM
YukonSoDank Re: Need VBA to create new... 05-31-2019, 02:53 PM
Mumps1 Re: Need VBA to create new... 06-01-2019, 12:33 PM
YukonSoDank Re: Need VBA to create new... 06-01-2019, 03:28 PM
Mumps1 Re: Need VBA to create new... 06-02-2019, 07:49 AM
YukonSoDank Re: Need VBA to create new... 06-02-2019, 09:23 AM
Mumps1 Re: Need VBA to create new... 06-03-2019, 09:59 AM
YukonSoDank Re: Need VBA to create new... 06-08-2019, 02:47 PM
  1. #11
    Registered User
    Join Date
    04-02-2019
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    74

    Re: Need VBA to create new Workbook and name it based on cell value in original file

    So, on this one...I use the code below (thanks again) to populate a file that I select called, "Model_Template" which I have attached. It works great.

    That said, how could I change this code to append each update into the same file. In other words, ideally each time I run this macro the three tabs found in "Model_Template" duplicate and populate with the new information, appending to the end of the tab series while keeping the existing models/tabs.

    Sub Calculate()

    'Dim t1 As Double, t2 As Double
    't1 = Timer
    ' Application.ScreenUpdating = False
    Application.Calculate
    ' Application.ScreenUpdating = True
    '
    't2 = Timer
    'msg = MsgBox("Done; " & Round(t2 - t1, 0) & " seconds elapsed.", vbOKOnly, "Goal Seek Complete")

    Application.ScreenUpdating = False
    Dim desWB As Workbook, desWS As Worksheet, srcWS1 As Worksheet, srcWS2 As Worksheet
    Dim flder As FileDialog, FileName As String, FileChosen As Integer
    Set srcWS1 = ThisWorkbook.Sheets("Detailed Outputs")
    Set srcWS2 = ThisWorkbook.Sheets("User Inputs")
    Set flder = Application.FileDialog(msoFileDialogFilePicker)
    flder.Title = "Please Select a file."
    flder.InitialFileName = Environ("userprofile") & "\Desktop\Upwork\"
    FileChosen = flder.Show
    FileName = flder.SelectedItems(1)
    Set desWB = Workbooks.Open(FileName)
    Set desWS = Sheets("Input")
    With srcWS1
    .Range("B8:M8").Copy
    desWS.Range("Q4").PasteSpecial xlPasteValues
    .Range("B45:M45 ").Copy
    desWS.Range("Q5").PasteSpecial xlPasteValues
    .Range("B28:M28").Copy
    desWS.Range("Q8").PasteSpecial xlPasteValues
    .Range("B75:M75").Copy
    desWS.Range("Q9").PasteSpecial xlPasteValues


    Application.CutCopyMode = False
    End With
    ActiveWorkbook.SaveAs FileName:=ActiveWorkbook.Path & Application.PathSeparator & srcWS2.Range("C14").Value & ".xlsx", FileFormat:=51
    Application.ScreenUpdating = True

    msg = MsgBox("Calculation complete. See Outputs tabs and Project Model for results.")

    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. Replies: 5
    Last Post: 10-17-2018, 02:35 AM
  2. [SOLVED] Need to modify macro to also create backup of original file
    By tfilipe in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-15-2018, 03:25 PM
  3. open worksheet in a different workbook based on cell name in original workbook
    By thara95 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2017, 07:38 AM
  4. VBA that works perfectly in one file errors out in a new file based off the original!
    By carthesis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2016, 07:24 AM
  5. Replies: 1
    Last Post: 07-17-2014, 12:06 PM
  6. Splitting Excel file but want to create data links to original
    By hitchy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2013, 11:46 AM
  7. Trying to create a 2nd workbook to mirror the first, to protect the original
    By zachdking in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2013, 08:11 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