I am doing MM-DD
That means you have wrongly pasted the vba code .. Please make sure you insert a new module e. g module1 and shift the sub auto_open() to that new module....The Macro works when I run it however I have to re-run it every time I open the spreadsheet. shouldn't this be automatic?
Sub testthis_2()
Dim wbFile As Workbook, wsFile As Worksheet
Dim wbFullName As String, wbName As String, wsName As String
wbFullName = "C:\Users\SomeUser\Documents\Book2.xlsx"
wbName = "Book2.xlsx" ' Or wbName = Mid(wbFullName, InStrRev(wbFullName, "\") + 1)
wsName = Format(now(), "MM-DD")
On Error Resume Next
Set wbFile = Workbooks.Open(wbFullName, UpdateLinks:=False)
Set wsFile = Workbooks(wbName).Worksheets(wsName)
wsFile.Activate
On Error GoTo 0
End Sub
=MID(CELL("filename", $A$1), SEARCH("]", CELL("filename", $A$1))+1, 100)
ActiveSheet.Name = "Test_Sheet"