mehmetcik,
Thanks for your interest.
The routine OutputText is called by the following routine fired by clicking a button on a userform.
Private Sub BTFile_Click()
FilePath = Sheets("Utilities").Range("N16").Value ' "P:\Andrew and John Southern Shared\Budgets" in this case
SaveName = "Budget " & Sheets("Utilities").Range("P7").Value '"2018-2019" in this case
Output FilePath, SaveName, xlOpenXMLWorkbook 'Working copy For Andrew
With Sheets("Budget_For_Cerm")
.Range("Budget_for_Cerm_Clear1").Clear
.Range("Budget_For_Cerm_Clear2").Clear
End With
PasteDownN "Budget_For_Cerm", 1
PasteDownN "Budget_for_Cerm", 2
FileType = xlTEXT
OutputText "Budget_For_Cerm", "Budget_For_Cerm_File", SaveName, FilePath, FileType
End Sub
The routine PasteDownN is simply a way of copying and pasting formulae.
The reason I have two output routines, Output and OutputText, is that Output deals with those situations where I need to copy to several sheets in a new workbook.
Bookmarks