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"
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.
|Excel Excel Help -- IRR Calc for 3o months||0|
|Excel Excel 'end of month' datedif and Conditional formatting||1|
|Excel How to add a calendar month to and existing excel file created in a template||1|
|Access Count dates within a Month||4|
|Access Getting Month periods to show in ACCESS query as 0 when there is no data for the month||0|
|Excel Excel - Can the date format dd-mmm-yyyy display the month in upper case?||1|
|Excel Date of first friday every month||3|
|Excel Message box with days of month & date.||1|