WorkbookNew_ANmar

Creates new workbook (does not save it) and returns filename.

Function WorkbookNew_ANmar()
' creates a new workbook and returns its name
secScreen = Application.ScreenUpdating
Application.ScreenUpdating = False
Workbooks.Add
WorkbookNew_ANmar = ActiveWorkbook.Name
Application.ScreenUpdating = secScreen
ThisWorkbook.Activate
End Function

wknam = WorkbookNew_ANmar("Data")
wknam = WorkbookNew_ANmar("New.csv", , 1)
If WorkbookNew_ANmar("expenses.csv", 0) = "" Then msgbox "Please close file before continue"

Views 1841 Downloads 800


ANmarAmdeen
592
Components VBA-Excel
Revisions

v2.0