Skip to content

Get Current Workbook Name

I’m sure this could be done better. But nonetheless, it works.

Function getWBname()
    Dim wb As String
    wb = Application.ActiveWorkbook.Name
    wb = Replace(wb, ".xlsm", ".")
    wb = Replace(wb, ".xlsx", ".")
    wb = Replace(wb, ".xls", ".")
    getWBname = wb
End Function
Published inVBA

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *