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
Bookmarks